-
Notifications
You must be signed in to change notification settings - Fork 61
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
Ensure correct OpenAPI 3.1.0 spec. #646
Merged
Merged
Changes from 27 commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
54ffcf8
Added Python and Ruby spec validators.
dblock 92e711e
Add empty descriptions where missing and remove descriptions next to …
dblock fffaae3
Replaced the validator compatible with OpenAPI 3.1.
dblock 63051b4
Fixed incorrect style.
dblock 2dafa40
Added missing require.
dblock 5736735
Fix: schema null is not supported.
dblock 8c42278
Removed unused required property.
dblock c0ea5ff
Fix: added missing schema.
dblock d8ffd3f
Fix: removed incorrect defaults.
dblock 2b63431
Fix: added missing required.
dblock beb6eeb
Fix: removed incorrect required.
dblock fc4730c
Removed incorrect externalDocs.
dblock 04716ca
Document the ruby spec validator.
dblock 7bf5b00
Fix: removed redundant content types.
dblock a4b83f5
Improve displaying of errors.
dblock 6610faa
Normalize keys to be compatible with OpenAPI 3.1.
dblock 5485529
Removed superseeded operations that have unresolved parameters.
dblock f3759a1
Fix: don't reduce error payload, allows to verify schema.
dblock 732fde0
Fix: flow framework schema tests.
dblock 4abc6be
Fix: if no decision is made there's no weight ranking.
dblock bc24479
Fix: wrap indexing errors.
dblock 52783ee
Added verbose logging of the story being evaluated.
dblock 635e180
Fix: security API test error responses.
dblock 7b0c299
Fix: duration ref.
dblock 0a15d96
Fix typo in property.
dblock 8e3e4c5
Fix superseeded operation parameters.
dblock acf7788
Fix: neural search error response.
dblock 50c3258
Normalize fields.
dblock d1a1bac
Re-added default values into the schema.
dblock 359e6f8
Disallowed characters are replaced with ___.
dblock File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Validate Spec (Python) | ||
|
||
on: [pull_request,push] | ||
|
||
jobs: | ||
validate-spec-py: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Build | ||
run: npm ci && npm run merge | ||
|
||
- name: Set Up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Install Dependencies | ||
working-directory: tools/src/validate-spec-py | ||
run: | | ||
pip install --user pipenv | ||
pipenv install | ||
|
||
- name: Validate Spec | ||
working-directory: tools/src/validate-spec-py | ||
run: | | ||
pipenv run python validate.py ../../../build/opensearch-openapi.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Validate Spec (Ruby) | ||
|
||
on: [pull_request, push] | ||
|
||
jobs: | ||
validate-spec-ruby: | ||
runs-on: ubuntu-latest | ||
env: | ||
BUNDLE_GEMFILE: ${{ github.workspace }}/tools/src/validate-spec-ruby/Gemfile | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
|
||
- name: Build | ||
run: npm ci && npm run merge | ||
|
||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.3' | ||
bundler-cache: true | ||
|
||
- name: Validate Spec | ||
working-directory: tools/src/validate-spec-ruby | ||
run: | | ||
bundle exec ruby validate.rb ../../../build/opensearch-openapi.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should move the default values into their respective schemas in this case.
We should also add
x-default
extension for parameters when the default for the param differs from the default of the schema OR when a shared schema itself doesn't have a default but certain param using said schema does.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did the first part, didn't realize that default should/can be nested under
schema
when I was removing this.I don't think we have a case where the default differs, do you know of one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't come across on where the schema itself has a default that is different from the param that uses it. But I've come across schemas that are used in different params of different operations but have different default values depending on the operation. But That was a long time ago, before we moved onto OpenAPI. But that's still a real possibility.