influxdata / openapi

An OpenAPI specification for influx (cloud/oss) apis.
MIT License
17 stars 10 forks source link

schemas fail swagger-cli validation #239

Open rogpeppe opened 2 years ago

rogpeppe commented 2 years ago

commit 12c8165b70cb379486592ffbf43ac5a3dde04904

By way of sanity checking, I thought I'd run the schemas through the swagger-cli validator, and they don't seem to pass validation:

% swagger-cli validate oss.yml
Swagger schema validation failed. 
  Data does not match any schemas from 'oneOf' at #/components/securitySchemes/TokenAuthentication
    Missing required property: $ref at #/components/securitySchemes/TokenAuthentication
    Data does not match any schemas from 'oneOf' at #/components/securitySchemes/TokenAuthentication
      Missing required property: in at #/
      Data does not match any schemas from 'oneOf' at #/
        No enum match for: token at #/scheme
        Data matches schema from 'not' at #/
      Missing required property: flows at #/
      Missing required property: openIdConnectUrl at #/

JSON_OBJECT_VALIDATION_FAILED

It seems that the security schemas don't match the OpenAPI 3.1 specification (for example the TokenAuthentation scheme should probably be defined as scheme: bearer as a token scheme doesn't seem to exist).

glinton commented 2 years ago

Good catch, we should change that as well as add an additional ci step that runs the validation. Only caveat is that changing "token" to "bearer" shouldn't affect what the header value is set to (the api accepts Authorization: Token abc123, but not (maybe not always) Authorization: bearer abc123).