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 custom name for body parameter in serialization for V2 #486

Closed
asvishnyakov opened this issue Jun 16, 2020 · 4 comments
Closed

Support custom name for body parameter in serialization for V2 #486

asvishnyakov opened this issue Jun 16, 2020 · 4 comments
Labels
type:enhancement Enhancement request targeting an existing experience
Milestone

Comments

@asvishnyakov
Copy link
Contributor

Or make code extendable to allow do it on customer side.

var bodyParameter = new OpenApiBodyParameter
{
Description = RequestBody.Description,
// V2 spec actually allows the body to have custom name.
// Our library does not support this at the moment.
Name = "body",
Schema = content?.Schema ?? new OpenApiSchema(),
Required = RequestBody.Required
};

@darrelmiller
Copy link
Member

If we auto-create an x-name when importing a v2 document and round-trip that when writing as v2, would that solve the problem for you?

@asvishnyakov
Copy link
Contributor Author

@darrelmiller It's better to set name, of course. If you can't/don't want to fix issue this way, then probably you may just close it. #485 can be used as workaround.

@darrelmiller
Copy link
Member

@asvishnyakov Sorry, I phrased that badly. We can set the name property when we render in V2. In V3 and in the OpenApiDocument the value would be stored as an extension.

@darrelmiller darrelmiller added this to the 1.3 milestone Jul 2, 2020
@darrelmiller darrelmiller added the type:enhancement Enhancement request targeting an existing experience label Jul 2, 2020
@darrelmiller
Copy link
Member

This is now enabled in 1.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Enhancement request targeting an existing experience
Projects
None yet
Development

No branches or pull requests

2 participants