ga4gh-beacon / beacon-v2

Unified repository for the GA4GH Beacon v2 API standard
Creative Commons Zero v1.0 Universal
23 stars 20 forks source link

Invalid Syntax in `/filtering_terms` response #138

Open datsirul opened 1 month ago

datsirul commented 1 month ago

The file endpoints.yaml contains invalid OpenAPI syntax.

Existing Syntax:

  /filtering_terms:
    parameters:
      - $ref: '#/components/parameters/skip'
      - $ref: '#/components/parameters/limit'
    get:
      description: Get the list of filtering terms handled by this beacon
      operationId: getFilteringTerms
      tags:
        - Informational endpoints
      responses:
        '200':
          $ref: ./responses/beaconFilteringTermsResponse.yaml
        default:
          description: An unsuccessful operation.
          $ref: ./responses/beaconErrorResponse.yaml

Corrected Syntax: As this file is a response definition, it should be defined as a response object in the OpenAPI specification. The correct syntax should be:

  /filtering_terms:
    parameters:
      - $ref: '#/components/parameters/skip'
      - $ref: '#/components/parameters/limit'
    get:
      description: Get the list of filtering terms handled by this beacon
      operationId: getFilteringTerms
      tags:
        - Informational endpoints
      responses:
        '200':
          description: Successful operation.
          content:
            application/json:
              schema: 
                $ref: ./responses/beaconFilteringTermsResponse.yaml
        default:
          description: An unsuccessful operation.
          $ref: ./responses/beaconErrorResponse.yaml

Reference: OpenAPI Specification - Describing Responses

Note: After fixing the .yaml files, the .json should be fixed as well by running the schema conversion script located in the bin folder.

jrambla commented 1 month ago

PR, please