Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support $ref in requestBody #4917

Merged
merged 5 commits into from
Jul 17, 2024

Conversation

eatdrinksleepcode
Copy link
Contributor

Fixes #2122

This MR adds support for $ref in requestBody, as well as requestBodies in components.

Since the existing implementation does not attempt to do cross-updates between OpenApiRequestBody and a referenced OpenApiParameter, so this MR does not attempt to cross-update the other direction.

@eatdrinksleepcode eatdrinksleepcode force-pushed the actual-request-body branch 2 times, most recently from 64474b1 to 1018295 Compare June 17, 2024 02:16
@eatdrinksleepcode eatdrinksleepcode deleted the actual-request-body branch June 17, 2024 03:27
@eatdrinksleepcode eatdrinksleepcode restored the actual-request-body branch June 17, 2024 03:30
@RicoSuter RicoSuter merged commit 7d6df3a into RicoSuter:master Jul 17, 2024
3 checks passed
@RicoSuter
Copy link
Owner

Thanks for the PR.

@NavirDev
Copy link

NavirDev commented Jul 18, 2024

Hey guys. This is the support for external files I guess. What about request requestBodies in the same file.

I still have an exception.

Example:
14.1.0
image

The .yaml snippet looks like this
image
image

It's not generating the request object at all. When i change the requestBody to this:
image

Then the reference can not be found.

@RicoSuter
Copy link
Owner

This is not part of nswag v14.1.0… part of next release

@NavirDev
Copy link

Thank you Rico :-)

@Eruzo
Copy link

Eruzo commented Jul 26, 2024

I thought my pull request #4747 was now unneeded. But this change does not what I expect. With this I still get object? body instead of PersonsSearchCriteria body @eatdrinksleepcode

I updated my pull request to add the missing code. Is that the cross update you mentioned?

@eatdrinksleepcode eatdrinksleepcode deleted the actual-request-body branch September 20, 2024 18:56
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.

Reusable (Request/Response) Object
4 participants