I have an OData api and I enabled swagger for that. When I paste the json information of my OData api in "editor.swagger.io" then it gives me the error : (Semantic error at paths ./BankBranches.get.responses.200.schema.$ref $ref values must be RFC3986-compliant percent-encoded URIs)
I have below lines in responses :
responses: '200': description: OK schema: $ref: '#/definitions/ODataResponse[List[BankBranch]]'
I know that I can solve the problem by removing all the "[" , "]" but It is too hard and takes too much time in big projects. I do not know how to change in my OData api to do not have this problem??
if your swaggerResponse looks something like
[SwaggerResponse(HttpStatusCode.OK, "OK Result", typeof(IEnumerable<int>))]
you could create a wrapper for the response
public class MyResponse: IEnumerable<ItemGroup>> {}
and update
[SwaggerResponse(HttpStatusCode.OK, "OK Result", typeof(MyResponse))]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With