Skip to content

Conversation

@dbanty
Copy link
Collaborator

@dbanty dbanty commented Jun 15, 2024

This PR was created by Knope. Merging it will create a new release

Features

Support request body refs

You can now define and reuse bodies via refs, with a document like this:

paths:
  /something:
    post:
      requestBody:
        "$ref": "#/components/requestBodies/SharedBody"
components:
  requestBodies:
    SharedBody:
      content:
        application/json:
          schema:
            type: string

Thanks to @kigawas and @supermihi for initial implementations and @RockyMM for the initial request.

Closes #633, closes #664, resolves #595.

Fixes

@dbanty dbanty merged commit cb32c30 into main Jun 15, 2024
@dbanty dbanty deleted the release branch June 15, 2024 19:47
micha91 pushed a commit to micha91/openapi-python-client that referenced this pull request May 13, 2025
This PR was created by Knope. Merging it will create a new release

### Features

#### Support request body refs

You can now define and reuse bodies via refs, with a document like this:

```yaml
paths:
  /something:
    post:
      requestBody:
        "$ref": "#/components/requestBodies/SharedBody"
components:
  requestBodies:
    SharedBody:
      content:
        application/json:
          schema:
            type: string
```

Thanks to @kigawas and @supermihi for initial implementations and
@RockyMM for the initial request.

Closes openapi-generators#633, closes openapi-generators#664, resolves openapi-generators#595.

### Fixes

- Indent of generated code for non-required lists. Thanks @sfowl!
(openapi-generators#1050)
- Parsing requestBody with $ref (openapi-generators#633)

Co-authored-by: GitHub <github-actions@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The requestBody declared with $ref is not generating json_body

2 participants