Title: Quotes in Content-Type cause syntax errors · Issue #1350 · openapi-generators/openapi-python-client · GitHub
Open Graph Title: Quotes in Content-Type cause syntax errors · Issue #1350 · openapi-generators/openapi-python-client
X Title: Quotes in Content-Type cause syntax errors · Issue #1350 · openapi-generators/openapi-python-client
Description: Describe the bug Running openapi-python-client generate --path api.yml on the input file below fails with: Generating /tmp/example-client Error(s) encountered while generating, client was not created ruff failed example_client/api/defaul...
Open Graph Description: Describe the bug Running openapi-python-client generate --path api.yml on the input file below fails with: Generating /tmp/example-client Error(s) encountered while generating, client was not creat...
X Description: Describe the bug Running openapi-python-client generate --path api.yml on the input file below fails with: Generating /tmp/example-client Error(s) encountered while generating, client was not creat...
Opengraph URL: https://github.com/openapi-generators/openapi-python-client/issues/1350
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Quotes in Content-Type cause syntax errors","articleBody":"**Describe the bug**\nRunning `openapi-python-client generate --path api.yml` on the input file below fails with:\n\n```\nGenerating /tmp/example-client\nError(s) encountered while generating, client was not created\n\nruff failed\n\nexample_client/api/default/put_object.py:34:62: SyntaxError: Simple statements must be separated by newlines or semicolons\n |\n33 | _kwargs[\"json\"] = _body\n34 | headers[\"Content-Type\"] = \"application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"\"\n | ^\n35 |\n36 | _kwargs[\"headers\"] = headers\n |\n[...]\n```\n\nQuotes in the Content-Type should be escaped so that the generated result is legal Python code.\n\n\n**OpenAPI Spec File**\n```\nopenapi: \"3.0.0\"\n\ninfo:\n version: 0.0.1\n title: example\n\npaths:\n /object:\n put:\n requestBody:\n content:\n \"application/ld+json; profile=\\\"https://www.w3.org/ns/activitystreams\\\"\":\n schema:\n type: string\n responses:\n '200':\n description: OK\n```\n\n**Desktop (please complete the following information):**\n - OS: Debian 13\n - Python Version: 3.12.11\n - openapi-python-client version: 0.24.3\n","author":{"url":"https://github.com/FenTiger","@type":"Person","name":"FenTiger"},"datePublished":"2025-11-01T10:10:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/1350/openapi-python-client/issues/1350"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:30524c4c-021e-58e7-779e-764fb13b3b18 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E91E:DBF78:1C2C77B:262D89D:698076CB |
| html-safe-nonce | db17eb4ebba7dfd03b0bbf1017e96e88968c0f67cf1df73a74822374caad8442 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOTFFOkRCRjc4OjFDMkM3N0I6MjYyRDg5RDo2OTgwNzZDQiIsInZpc2l0b3JfaWQiOiIyMjE3ODM4NTcyNzQyOTMyMTcxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | bf6b53691ad317302331b95952bd696634f7e18951a54d9caa0c1a6cf3158f27 |
| hovercard-subject-tag | issue:3577765835 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/openapi-generators/openapi-python-client/1350/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b6514fe16560bb56cdcec57370e319f00fcce2f92b91f91ef5efec4d542df87e/openapi-generators/openapi-python-client/issues/1350 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b6514fe16560bb56cdcec57370e319f00fcce2f92b91f91ef5efec4d542df87e/openapi-generators/openapi-python-client/issues/1350 |
| og:image:alt | Describe the bug Running openapi-python-client generate --path api.yml on the input file below fails with: Generating /tmp/example-client Error(s) encountered while generating, client was not creat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | FenTiger |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0959b1a93ca48b0c88b3bddbdfd04ca43f388cb1a8293105a28c5ef6e8079db8 |
| turbo-cache-control | no-preview |
| go-import | github.com/openapi-generators/openapi-python-client git https://github.com/openapi-generators/openapi-python-client.git |
| octolytics-dimension-user_id | 84925606 |
| octolytics-dimension-user_login | openapi-generators |
| octolytics-dimension-repository_id | 240776275 |
| octolytics-dimension-repository_nwo | openapi-generators/openapi-python-client |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 240776275 |
| octolytics-dimension-repository_network_root_nwo | openapi-generators/openapi-python-client |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 78307334c66591a8f87f493dd2968126b34961dd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width