-
Notifications
You must be signed in to change notification settings - Fork 0
Add support for document $self property (OAI 3.2.0) #28
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
$selfproperty 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
Selfproperty (Uri?) toOpenApiDocumentclass$selfconstant toOpenApiConstantsSerialization
The property serializes differently based on the OpenAPI version:
OpenAPI 3.2.0+
OpenAPI 3.1.x and 3.0.x
Deserialization
$selffield via V32 deserializerx-oai-$selfextension via V31 deserializer (extension is properly extracted into theSelfproperty and not left in the extensions dictionary)x-oai-$selfextension via V3 deserializerTesting
Serialization Tests
OpenApiDocumentTests.cscovering all OpenAPI versions (3.0, 3.1, 3.2)Deserialization Tests
$selfproperty (YAML and JSON formats)x-oai-$selfextension with verification that the property is moved toSelfand not left inExtensionsAll 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.