feat(rulesets): improve OAS 3.1 external references validation#2844
feat(rulesets): improve OAS 3.1 external references validation#2844fluz wants to merge 5 commits intostoplightio:developfrom
Conversation
- Update OAS 3.1 schema to better support external references - Add external references test scenario in test-harness - Update Arazzo schema validators to use improved OAS 3.1 schema - Enhance OAS 3 schema test coverage Fixes issues with external reference validation in OpenAPI 3.1 documents.
a7c06e7 to
fde1451
Compare
|
Hi someone can review my proposal. TIA |
|
Hi Pals, just a kindly reminder to not forget my PR 🙏🏾 :-) |
|
Hi @mnaumanali94 , can you please take a look on this PR when you have time 🙏🏾 :-) |
|
Could you please take a look at my PR? 🙏🏾 Thanks! |
|
Thank you @fluz for providing a fix for this issue. The |
|
Hi @stoplightio/oss-spectral Please take a look when it is possible in this PR. 🙏🏾 Thanks in advance |
|
@fluz did you consider requesting a review personally (not from the whole team)? |
|
@katepol I tried, but I will check again who can support us on this :-/ |
|
@tomek-tursa-sb @tekyu you both seem to have privilege to approve and merge PRs. Could you please have a look here? It's open for 6 months without any feedback from the team. If you don't want to merge: Who's the right person to contact? |
|
@tomek-tursa-sb @SB-rohitdesai @tekyu @mattshaner can you support us and take an eye on this PR 🙏🏾 |
|
@tomek-tursa-sb @SB-rohitdesai @fluz We should close this PR, I dont think we should change the oas/v3.1, the oas json is the official ruleset from openapi. Looking into the latest oas schema version the |
@NelDev1104, I couldn't find the changes in your link, the Maybe I'm looking in the wrong place. Could you please clarify where the difference is? |
|
@fluz "paths": {
"type": "object",
"patternProperties": {
"^/": {
"$ref": "#/$defs/path-item"
}
},
"$ref": "#/$defs/specification-extensions",
"unevaluatedProperties": false
},
"path-item": {
"type": "object",
"properties": {
"summary": {
"type": "string"
},
"description": {
"type": "string"
},
"servers": {
"type": "array",
"items": {
"$ref": "#/$defs/server"
}
},
"parameters": {
"type": "array",
"items": {
"$ref": "#/$defs/parameter-or-reference"
}
}
},Oas 3.1 latest version "paths": {
"$comment": "https://spec.openapis.org/oas/v3.1#paths-object",
"type": "object",
"patternProperties": {
"^/": {
"$ref": "#/$defs/path-item"
}
},
"$ref": "#/$defs/specification-extensions",
"unevaluatedProperties": false
},
"path-item": {
"$comment": "https://spec.openapis.org/oas/v3.1#path-item-object",
"type": "object",
"properties": {
"$ref": {
"type": "string",
"format": "uri-reference"
},
"summary": {
"type": "string"
},
"description": {
"type": "string"
},
"servers": {
"type": "array",
"items": {
"$ref": "#/$defs/server"
}
},
"parameters": {
"type": "array",
"items": {
"$ref": "#/$defs/parameter-or-reference"
}
},In the current version $ref is missing in the properties path-item |
Nice 😍 , thanks for the clarification. Feel free to close this one and open a new one. But I think the most important thing is to have this issue solved 😢. |
Fix schema validation error where path items were incorrectly flagged as having unevaluated properties. Changed paths pattern properties to use path-item-or-reference instead of path-item to support external references in OpenAPI 3.1 specifications properly.
Fixes the issue where documents like:
Would generate:
"~1greetings" property must not have unevaluated properties.Fixes #2655
Checklist
Does this PR introduce a breaking change?