[Bug] Matching route parameters to complex object breaks Swagger UI
See original GitHub issueSwagger UI:
The {id}
does not get replaced with the string when executing the request.
When manually replacing and doing the GET request it works.
I found #513 which kind of relates to this. But it is more like the feature request for this.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Use object type query param in swagger documentation
I have a GET route where I would like to encode an object parameter in the url as a query string. When writing...
Read more >Step 5: The components object (OpenAPI tutorial)
Describing the details of your parameters and describing the schema of complex responses can be the most challenging aspects of the OpenAPI ...
Read more >Swagger PUT/POST body value issue
We're experiencing exactly the same bug. Removing ParameterType=body allows the Post function to read the values correctly, but breaks all of ...
Read more >c# - Servicestack object parameter not getting passed to ...
Your Request DTO doesn't match the declared Swagger schema, CreditCard isn't the body it's just a parameter that has a complex type value....
Read more >SwaggerHub On-Premise Release Notes
SwaggerHub On-Premise 2.0 must be a new installation. There is a migration path for existing 1.x instances to transfer your data to the...
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 Free
Top 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
This is still an issue.
When using SwaggerUI and the route parameter is a different case than the model’s property, then “Try It Out” fails to serialize. This works works correctly outside of SwaggerUI (e.g. Postman, HttpClients)
.. api/persons/{id}
UpdatePerson([FromRoute] Person person) { }
Debug error: “System.ArgumentException: ‘{id} is not a valid value for Int32. (Parameter ‘value’)’”
Tried and does not work:
JsonProperty("id")
[System.Text.Json.Serialization.JsonPropertyName("id")]
Changing the route to be
../person/{**Id**}
works (capitalizing the parameter), but I would rather not make this change just to fix an issue with NSwag’s SwaggerUI implementation.I am experiencing the same thing with a Mongo ObjectId.
I have tried adding TypeMappers and SerializationSettings