-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add support for OpenAPI SpecificationExtensions to the SwaggerExample.Create method #223
Comments
Hi Tom I'm not familiar with OpenApi specification extensions. What do you mean by "example specific values"? What would you like to accomplish? |
Hi Matt From the OpenAPI Spec The goal would be to emit something like this into to OpenAPI File
Note the custom extension " x-example-extension: " in the context of this specific example (at the bottom) |
Thanks for the explanation. It's not something I've needed to use, and I don't really want it to be supported by this filter. Did you know you can provide examples for headers and querystring parameters via XML comments? Is that what you need? /// <summary>
/// Test endpoint
/// </summary>
/// <param name="idempotencyKey" example="00000000-0000-0000-0000-000000000000"></param>
/// <param name="wpTransactionId" example="123456"></param>
[HttpGet("api/values/header")]
public void HeaderTest([FromHeader] string idempotencyKey, string wpTransactionId)
{
} This filter doesn't support adding examples to headers or request parameters, but that is something that could be added. |
Thanks for the comment about the example tag in the XML Comments. Relative to: This filter doesn't support adding examples to headers or request parameters, but that is something that could be added. What if in the case of supplying multiple examples... the sample values for headers or request parameter should be different for each example? |
I use this package to create multiple examples for request bodies that contain complex POCO objects, ex:
Would you consider adding support for an Extensions property similar to the one here: OpenApiExample.Extensions Property
This is related to OpenAPI specification extensions
This capability could be used by some portal tools to extend example support to include example specific values for:
The text was updated successfully, but these errors were encountered: