Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 30, 2025

Implementation Plan for deviceAuthorizationUrl in OAuthFlow

  • Add DeviceAuthorizationUrl property to OpenApiOAuthFlow model
  • Add DeviceAuthorizationUrl constant to OpenApiConstants
  • Update serialization logic in OpenApiOAuthFlow.SerializeInternal:
    • For OpenAPI 3.2+: serialize as "deviceAuthorizationUrl"
    • For OpenAPI 3.1: serialize as "x-oai-deviceAuthorizationUrl" (extension)
    • For OpenAPI 3.0: serialize as "x-oai-deviceAuthorizationUrl" (extension)
  • Update deserialization logic:
    • Add to V32 deserializer (deviceAuthorizationUrl)
    • Add to V31 deserializer (x-oai-deviceAuthorizationUrl in pattern fields)
    • Add to V3 deserializer (x-oai-deviceAuthorizationUrl in pattern fields)
  • Update copy constructor to include DeviceAuthorizationUrl
  • Add tests for serialization in all versions
  • Add tests for deserialization in all versions
  • Update PublicApi.approved.txt
  • Run performance benchmark and include updated files
  • Address code review feedback

Summary

Successfully implemented the deviceAuthorizationUrl field for the OAuthFlow object as defined in OpenAPI 3.2.0 specification. The implementation includes:

  1. Model Changes: Added DeviceAuthorizationUrl property to OpenApiOAuthFlow class
  2. Constants: Added DeviceAuthorizationUrl constant to OpenApiConstants
  3. Serialization:
    • OpenAPI 3.2+: Serializes as deviceAuthorizationUrl (standard field)
    • OpenAPI 3.1/3.0: Serializes as x-oai-deviceAuthorizationUrl (extension with prefix)
  4. Deserialization: Updated all version deserializers with proper pattern field handling for extensions
  5. Tests: Added comprehensive tests using JsonNode.DeepEquals for accurate JSON comparison
  6. Public API: Updated the public API export file to reflect the new property and constant

All tests pass (901 tests in Microsoft.OpenApi.Tests, 331 in Readers.Tests, 54 in Hidi.Tests), and performance benchmarks have been run and included in the commit.

Original prompt

This section details on the original issue you should resolve

<issue_title>OauthFlow new field - deviceAuthorizationUrl</issue_title>
<issue_description>OAI 3.2.0 defines a new field to the oauthflow object deviceAuthorizationUrl (string?)

We should add the property to the model, and implement serialization/deserialization.

For OpenAPI 3.1.0, serialize with an x-oai- prefix to make it an extension</issue_description>

<agent_instructions>make sure you update the public API export.
before committing changes, run the following command cd performance/benchmark && dotnet run -c Release and include the updated files in the commit</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #13

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@Copilot Copilot AI changed the title [WIP] OauthFlow new field - deviceAuthorizationUrl Add deviceAuthorizationUrl field to OAuthFlow object for OpenAPI 3.2.0 support Sep 30, 2025
@Copilot Copilot AI requested a review from baywet September 30, 2025 18:26
Copilot finished work on behalf of baywet September 30, 2025 18:26
Copy link
Author

Copilot AI commented Sep 30, 2025

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

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:

  • example.org926f4f21-88e7-4dc5-bf88-6c529bb77844
    • Triggering command: /usr/share/dotnet/dotnet exec --runtimeconfig /home/REDACTED/work/OpenAPI.NET/OpenAPI.NET/test/Microsoft.OpenApi.Hidi.Tests/bin/Release/net8.0/Microsoft.OpenApi.Hidi.Tests.runtimeconfig.json --depsfile /home/REDACTED/work/OpenAPI.NET/OpenAPI.NET/test/Microsoft.OpenApi.Hidi.Tests/bin/Release/net8.0/Microsoft.OpenApi.Hidi.Tests.deps.json /home/REDACTED/work/OpenAPI.NET/OpenAPI.NET/test/Microsoft.OpenApi.Hidi.Tests/bin/Release/net8.0/testhost.dll --port 36669 --endpoint 127.0.0.1:036669 --role client --parentprocessid 3977 --telemetryoptedin false (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@Copilot Copilot AI requested a review from baywet September 30, 2025 20:19
Copilot finished work on behalf of baywet September 30, 2025 20:19
Copilot AI and others added 5 commits September 30, 2025 16:29
- Added DeviceAuthorizationUrl property to OpenApiOAuthFlow model
- Added DeviceAuthorizationUrl constant to OpenApiConstants
- Updated serialization logic:
  - For OpenAPI 3.2: serializes as "deviceAuthorizationUrl"
  - For OpenAPI 3.1 and 3.0: serializes as "x-oai-deviceAuthorizationUrl" (extension)
- Updated deserialization logic for V32, V31, and V3 deserializers
- Updated copy constructor to include DeviceAuthorizationUrl
- Added tests for serialization in all versions (V3.0, V3.1, V3.2)
- Added tests for deserialization in all versions (V3.0, V3.1, V3.2)
- Updated PublicApi.approved.txt with new public API members
- Ran performance benchmarks and included updated results

Co-authored-by: baywet <[email protected]>
@baywet baywet force-pushed the copilot/fix-df8b3b6b-3cac-4fec-9202-099f3cefe3c5 branch from a7d0c35 to 1542284 Compare September 30, 2025 20:30
@baywet baywet marked this pull request as ready for review September 30, 2025 22:45
@baywet baywet enabled auto-merge September 30, 2025 22:45
@baywet baywet merged commit 264eaf8 into feat/oai-3-2-support Sep 30, 2025
6 checks passed
@baywet baywet deleted the copilot/fix-df8b3b6b-3cac-4fec-9202-099f3cefe3c5 branch September 30, 2025 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OauthFlow new field - deviceAuthorizationUrl

3 participants