-
Notifications
You must be signed in to change notification settings - Fork 0
Add support for document $self property (OAI 3.2.0) #28
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
Add support for document $self property (OAI 3.2.0) #28
Conversation
…ion support Co-authored-by: baywet <[email protected]>
Co-authored-by: baywet <[email protected]>
Co-authored-by: baywet <[email protected]>
@copilot You forgot to implement the deserialization changes in the following files:
Also move the unit tests introduced in test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentSelfPropertyTests.cs to test/Microsoft.OpenApi.Tests/Models/OpenApiDocumentTests.cs |
…d move tests to OpenApiDocumentTests Co-authored-by: baywet <[email protected]>
Done. Added deserialization support to both V31 and V32 deserializers and moved the tests to OpenApiDocumentTests.cs. Changes in commit 82a4229:
All 1278 tests pass. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
@copilot add additional unit tests for the deserialization of the new property. |
Co-authored-by: baywet <[email protected]>
Done. Added 3 deserialization unit tests in commit 91d3626: V32 Tests (native
V31 Test (x-oai-$self extension):
Created corresponding sample files for testing. All 1281 tests pass. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Summary
This PR implements support for the
$self
property added in OpenAPI 3.2.0, which provides a URI identifying the document itself. As specified in the OAI 3.2.0 specification, this property is serialized as a standard field in v3.2+ and as an extension (x-oai-$self
) in earlier versions.Changes
Property Definition
Self
property (Uri?
) toOpenApiDocument
class$self
constant toOpenApiConstants
Serialization
The property serializes differently based on the OpenAPI version:
OpenAPI 3.2.0+
OpenAPI 3.1.x and 3.0.x
Deserialization
$self
field via V32 deserializerx-oai-$self
extension via V31 deserializer (extension is properly extracted into theSelf
property and not left in the extensions dictionary)x-oai-$self
extension via V3 deserializerTesting
Serialization Tests
OpenApiDocumentTests.cs
covering all OpenAPI versions (3.0, 3.1, 3.2)Deserialization Tests
$self
property (YAML and JSON formats)x-oai-$self
extension with verification that the property is moved toSelf
and not left inExtensions
All 1281 tests pass with no regressions.
Notes
This implementation focuses on the property itself and does not include reference resolution updates, as specified in the issue requirements.
Fixes #8
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.