Skip to content

Conversation

@Eruzo
Copy link

@Eruzo Eruzo commented Jan 31, 2024

This pull request enhances support for the $ref keyword in request bodies. Given the following oas endpoint:

/end-point-uri:
    post:
      tags:
        - SomeTag
      summary: Search for something with a request body
      description: |
       Search something with a request body that is defined as a reference
      operationId: PostSearchSomething
      parameters:
        - $ref: '#/components/parameters/CorrelationId'
        - $ref: '#/components/parameters/ReferenceDate'
      requestBody:
        $ref: '#/components/requestBodies/PostSearchSomethingRequest'

The generator would generate the following function PostSearchSomethingRequestAsync(object body) with the supplied change it will generate PostSearchSomethingRequestAsync(PostSearchSomethingRequest body).

Fixes #4093 as well I think

@Eruzo Eruzo changed the title Allow $ref in requestBody of endpoint Add support for $ref in requestBody of endpoint Jan 31, 2024
@Eruzo Eruzo force-pushed the allow-ref-on-request-bodies branch from e51fca0 to 76c9d50 Compare January 31, 2024 14:18
@Eruzo Eruzo force-pushed the allow-ref-on-request-bodies branch 2 times, most recently from b5cd750 to 9211c03 Compare July 29, 2024 08:06
@Eruzo Eruzo changed the title Add support for $ref in requestBody of endpoint Enhance support for $ref in requestBody of endpoint Jul 29, 2024
@Eruzo Eruzo force-pushed the allow-ref-on-request-bodies branch from 9211c03 to f16bd20 Compare November 26, 2024 07:00
@RicoSuter
Copy link
Owner

Fixed by #5196

@RicoSuter RicoSuter closed this Sep 16, 2025
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.

Request body is mapped to object instead of DTO type

2 participants