biocad / openapi3

OpenAPI 3.0 data model
BSD 3-Clause "New" or "Revised" License
39 stars 54 forks source link

Wrong format when generating empty scopes map #63

Closed JohanWinther closed 1 year ago

JohanWinther commented 1 year ago

Having an empty _oAuth2Scopes map generates the following object which is invalid:

{
  "securitySchemes": {
    "OAuth2": {
      "description": "Description",
      "flows": {
        "clientCredentials": {
          "tokenUrl": "https://example.com"
        }
      },
      "type": "oauth2"
    }
  }
}

To make it valid the scopes property needs to be added, but with an empty object:

{
  "securitySchemes": {
    "OAuth2": {
      "description": "Description",
      "flows": {
        "clientCredentials": {
          "tokenUrl": "https://example.com",
          "scopes": {} // Added
        }
      },
      "type": "oauth2"
    }
  }
}
JohanWinther commented 1 year ago

I have found a fix and will submit a pull request soon.

EDIT: https://github.com/biocad/openapi3/pull/65

maksbotan commented 1 year ago

Fixed with #65, thanks!