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

[FEATURE][Spec Linter] Enforce string or string[] for comma-seperated path params #514

Open
nhtruong opened this issue Aug 15, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@nhtruong
Copy link
Collaborator

nhtruong commented Aug 15, 2024

Many OpenSearch path params accept an array of values in the form of comma-separated list of values. This can be represented as a string or an array:

schema:
  anyOf:
    - type: string
    - type: array
       items:
         type: string

However, many of of such path params in our spec are described as one of the two, but not both. To enforce this, we should look for 1 of the following:

  • If a path param is described as an array only, it should throw an error because that path param will also accept a comma-separated string equivalence.
  • If the description of the path param mentions comma separated or comma deliminated (with or without hyphen), we must also enforce string | string[] schema.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants