APIDevTools / swagger-parser

Swagger 2.0 and OpenAPI 3.0 parser/validator
https://apitools.dev/swagger-parser
MIT License
1.08k stars 153 forks source link

validator doesn't support anchor tags in the paths (ie /my/base/url#myAnchor) #245

Closed normana400 closed 11 months ago

normana400 commented 1 year ago

anchor tags are considered part of the url and technically within the spec of a valid url. I support active systems in production that successfully work with a swagger files that uses anchor tags, but this validator rejects them.

normana400 commented 1 year ago

in case you may wonder why a swagger url would have anchor tags in it, you can use anchor tags as part of a solution to to describe a "rest level 0" RPC type system successfully within the swagger requirements.

endpoint ' my/rpc/endpoint#api1 <- anchors makes the urls unique' ' my/rpc/endpoint#api2'

request backed with single defaulted enum request property for RPC dispatching to the target api:

 "Api1Request" : {
   "properties": {
     "rest_call" : {
       "type" : "string",
       "enum" : [ "api1" ],
       "default" : "api1"
    }
...
}
 "Api2Request" : {
   "properties": {
     "rest_call" : {
       "type" : "string",
       "enum" : [ "api2" ],
       "default" : "api2"
    }
...
}

`

philsturgeon commented 11 months ago

This is true! This is an old OpenAPI v3.0 based system, if you want something modern please go pick something from https://openapi.tools.

The valdation/linting in https://github.com/Redocly/redocly-cli/ is a lot better.