Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Syntax in /filtering_terms response #138

Open
datsirul opened this issue Jul 10, 2024 · 1 comment
Open

Invalid Syntax in /filtering_terms response #138

datsirul opened this issue Jul 10, 2024 · 1 comment

Comments

@datsirul
Copy link

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
Copy link
Contributor

jrambla commented Jul 10, 2024

PR, please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants