azure-functions-openapi-extension
azure-functions-openapi-extension copied to clipboard
Added Example property to OpenApi attribute
Added new Example property to the OpenApiPropertyAttribute. Allows settings an example value at an individual property level rather than only at the class/model. This is included in the OpenApi schema for the property and displays in the swagger schema and example.
Follows the same format as the Default property, i.e. allows string, number, boolean.
Example:
[OpenApiProperty(Description = "The name of the pet", Example = "Dog")]
public string Name { get; set; }
Property schema includes the example:
Model/schema example value also includes the property example:
@microsoft-github-policy-service agree company="Magnetism"
Is this PR likely to be reviewed any time soon? I have colleagues who would like to submit similar contributions for elements like "format", "minimum", "maximum", etc. At the moment there are too many things missing compared to what can be manually produced in SwaggerHub, and that feature gap is delaying our adoption of the APIM Developer Portal as a means of publishing APIs.
Very much interested in this as well!