Example not added to swagger output in case of string, byte and timespan
See original GitHub issueI not able to show example value of string, timespan, byte in swagger ui page. Error: 0x800a1391- Javascript runtime error: ‘jsyaml’ is undifned. To show example value i have created a class liker this
public class EmployeeExample: IExamplesProvider
{
public object GetExamples()
{
return "Sample Value"; // doing same this for timespan, byte , It's working fine for integer.
}
Please let me how can i resolve this issue ?
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Generating Swagger example responses with Swashbuckle
The Swagger 2.0 spec allows for examples to be added to the Response. ... Hi not able to show example value of string,...
Read more >OpenAPI Specification - Version 2.0
Version 2.0 specification defines a set of files required to describe an API. These files can then be used by the Swagger-UI project...
Read more >c# - How to define default values for parameters for the ...
This answer suggested placing [DefaultValue("value here")] attribute each property of the SomeRequest class. It may have worked for the regular ...
Read more >Specify an Array of Strings as Body Parameters in Swagger
In this tutorial, we'll show how to produce a default example value for String arrays, as this behaviour is not enabled by default....
Read more >DateTime and DateTimeOffset support in System.Text.Json
An overview of how DateTime and DateTimeOffset types are supported in the System.Text.Json library.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jitsingh89 I’m sure this is probably too late for you, but I have just tested this locally like this:
and I think it’s working
This is using Swashbuckle.AspNetCore 3.0 and my new Swashbuckle.AspNetCore.Filters package (to be released soon)
This works, you saved me