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

[BUG] Superseded operations paths do not align with defined paths #284

Open
Xtansia opened this issue May 7, 2024 · 0 comments
Open

[BUG] Superseded operations paths do not align with defined paths #284

Xtansia opened this issue May 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Xtansia
Copy link
Collaborator

Xtansia commented May 7, 2024

What is the bug?

The paths defined in the _superseded_operations.yaml do not match with the paths defined in the rest of the spec.

For example:
In _superseded_operations.yaml we have:

/_opendistro/_security/api/internalusers/{name}:
  superseded_by: /_plugins/_security/api/internalusers/{name}
  operations:
    - GET
    - PUT
    - DELETE
    - PATCH

However in namespaces/security.yaml we have:

paths:
  /_plugins/_security/api/internalusers/{username}:
    get:
      operationId: security.get_user.0
      x-operation-group: security.get_user
      x-version-added: '1.0'
      description: Retrieve one internal user.
      externalDocs:
        url: https://opensearch.org/docs/latest/security/access-control/api/#get-user
      parameters:
        - $ref: '#/components/parameters/security.get_user::path.username'
      responses:
        '200':
          $ref: '#/components/responses/security.get_user@200'

The path parameter names do not match, which means on merging we get:

paths:
  /_opendistro/_security/api/internalusers/{name}:
    get:
      operationId: security.get_user.0_superseded
      x-operation-group: security.get_user
      x-version-added: '1.0'
      description: Retrieve one internal user.
      externalDocs:
        url: https://opensearch.org/docs/latest/security/access-control/api/#get-user
      parameters:
        - $ref: '#/components/parameters/security.get_user::path.username'
        - $ref: '#/components/parameters/_global::query.pretty'
        - $ref: '#/components/parameters/_global::query.human'
        - $ref: '#/components/parameters/_global::query.error_trace'
        - $ref: '#/components/parameters/_global::query.source'
        - $ref: '#/components/parameters/_global::query.filter_path'
      responses:
        '200':
          $ref: '#/components/responses/security.get_user@200'
      deprecated: true
      x-ignorable: true

This means the final spec is incorrect as the path specifies {name} but we only provide a path param named username

@Xtansia Xtansia added bug Something isn't working untriaged labels May 7, 2024
@dblock dblock removed the untriaged label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants