RepreZen / KaiZen-OpenAPI-Editor

Eclipse Editor for the Swagger-OpenAPI Description Language
Eclipse Public License 1.0
115 stars 12 forks source link

[#347] OpenAPI v3: validation for SecurityRequirement#{securityScheme… #405

Closed ghillairet closed 6 years ago

ghillairet commented 6 years ago

…Name}

See #347

tfesenko commented 6 years ago

@ghillairet , thanks for a nice set of tests! Passed initial code review:

ghillairet commented 6 years ago

@tfesenko

I updated the messages and other suggestions.

Here are the new messages preceded by the invalid specs:

  /pets/{petId}:
    get:
      summary: Info for a specific pet
      operationId: showPetById
      security:
        - testScheme:
           - foo          
      responses:
        '200':
          description: Expected response to a valid request
components:            
  securitySchemes:
    testScheme:
      type: http

screen shot 2017-10-06 at 17 50 01

  /pets/{petId}:
    get:
      summary: Info for a specific pet
      operationId: showPetById
      security:
        - testScheme: [] 
      responses:
        '200':
          description: Expected response to a valid request
components:            
  securitySchemes:
    testScheme:
      type: oauth2

screen shot 2017-10-06 at 17 51 11

  /pets/{petId}:
    get:
      summary: Info for a specific pet
      operationId: showPetById
      security:
        - testScheme:
          - foo
      responses:
        '200':
          description: Expected response to a valid request
components:            
  securitySchemes:
    testScheme:
      type: oauth2
      flows:
        implicit:
          scopes:
            "write:pets": something

screen shot 2017-10-06 at 17 52 11

tedepstein commented 6 years ago

Looks good, @ghillairet , thanks.

tfesenko commented 6 years ago

Thanks! Passed QA and code review