Title: The requestBody declared with $ref is not generating json_body · Issue #595 · openapi-generators/openapi-python-client · GitHub
Open Graph Title: The requestBody declared with $ref is not generating json_body · Issue #595 · openapi-generators/openapi-python-client
X Title: The requestBody declared with $ref is not generating json_body · Issue #595 · openapi-generators/openapi-python-client
Description: Describe the bug If a requestBody is declared with a $ref, then no json_body property is generated. If the reference is inlined, then json_body is generated. To Reproduce Steps to reproduce the behaviour: Example schema: paths: "/objects...
Open Graph Description: Describe the bug If a requestBody is declared with a $ref, then no json_body property is generated. If the reference is inlined, then json_body is generated. To Reproduce Steps to reproduce the beh...
X Description: Describe the bug If a requestBody is declared with a $ref, then no json_body property is generated. If the reference is inlined, then json_body is generated. To Reproduce Steps to reproduce the beh...
Opengraph URL: https://github.com/openapi-generators/openapi-python-client/issues/595
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The requestBody declared with $ref is not generating json_body","articleBody":"**Describe the bug**\r\nIf a `requestBody` is declared with a `$ref`, then no `json_body` property is generated. If the reference is inlined, then `json_body` is generated.\r\n\r\n**To Reproduce**\r\nSteps to reproduce the behaviour:\r\n1. Example schema:\r\n```yaml\r\n\r\npaths:\r\n \"/objects\":\r\n post:\r\n operationId: object_create\r\n requestBody:\r\n $ref: \"#/components/requestBodies/Object\"\r\n\r\n\r\n```\r\n2. generated API is:\r\n```python\r\ndef sync_detailed(\r\n *,\r\n client: Client,\r\n) -\u003e Response[Object]:\r\n \"\"\"\r\n Returns:\r\n Response[Object]\r\n \"\"\"\r\n\r\n kwargs = _get_kwargs(\r\n client=client,\r\n )\r\n\r\n response = httpx.request(\r\n verify=client.verify_ssl,\r\n **kwargs,\r\n )\r\n\r\n return _build_response(response=response)\r\n```\r\n\r\n**Expected behavior**\r\nThe expected API should be:\r\n```python\r\ndef sync_detailed(\r\n *,\r\n client: Client,\r\n json_body: Object,\r\n) -\u003e Response[Object]:\r\n \"\"\"\r\n Args:\r\n json_body (Object):\r\n\r\n Returns:\r\n Response[Object]\r\n \"\"\"\r\n\r\n kwargs = _get_kwargs(\r\n client=client,\r\n json_body=json_body,\r\n )\r\n\r\n response = httpx.request(\r\n verify=client.verify_ssl,\r\n **kwargs,\r\n )\r\n\r\n return _build_response(response=response)\r\n```\r\n\r\n**OpenAPI Spec File**\r\n[test.yaml](https://gist.github.com/RockyMM/68de034f5f331e80f7fa831dd2a36086)\r\n\r\n","author":{"url":"https://github.com/RockyMM","@type":"Person","name":"RockyMM"},"datePublished":"2022-03-31T13:23:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/595/openapi-python-client/issues/595"}
| 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:1600100e-2877-3e8b-0941-ab1da855821b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B8E4:53009:1135517:15A16B3:697F1432 |
| html-safe-nonce | aeab032dbbaa873f3b021e6d7f89272b78fc497db604d74f0751a96f1e1aab53 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOEU0OjUzMDA5OjExMzU1MTc6MTVBMTZCMzo2OTdGMTQzMiIsInZpc2l0b3JfaWQiOiIzODcyMTczNTc3NTk5OTE1MDU4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c886c45176413c79c577798abae3cf0b04cde1262999665d116326e41980e0eb |
| hovercard-subject-tag | issue:1188073941 |
| 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/595/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0c5d1cd4da6a8f824c2728a134ef7f198d66ccbd7ab098d17746ff9bf8fa46b3/openapi-generators/openapi-python-client/issues/595 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0c5d1cd4da6a8f824c2728a134ef7f198d66ccbd7ab098d17746ff9bf8fa46b3/openapi-generators/openapi-python-client/issues/595 |
| og:image:alt | Describe the bug If a requestBody is declared with a $ref, then no json_body property is generated. If the reference is inlined, then json_body is generated. To Reproduce Steps to reproduce the beh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RockyMM |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| 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 | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width