Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 30, 2025

Summary

Successfully implemented the deprecated field for OpenAPI SecurityScheme as specified in OpenAPI 3.2.0 specification.

Changes Made

Core Implementation

  • Added Deprecated property to IOpenApiSecurityScheme interface
  • Added Deprecated property to OpenApiSecurityScheme class
  • Added Deprecated property to OpenApiSecuritySchemeReference class
  • Updated OpenApiSecurityScheme copy constructor to include Deprecated

Serialization

  • V3.2: Serializes as native deprecated: true field
  • V3.1: Serializes as x-oai-deprecated: true extension
  • V3.0: Serializes as x-oai-deprecated: true extension
  • V2.0: Field is omitted (not supported)

Deserialization

  • V3.2: Reads native deprecated field
  • V3.1: Reads x-oai-deprecated extension AND deprecated field (forward compatibility)
  • V3.0: Reads x-oai-deprecated extension

Testing

  • Added 3 serialization tests (V3.2, V3.1, V3.0)
  • Added 3 deserialization tests (V3.2, V3.1 with x-oai-deprecated, V3.1 with deprecated)
  • All 1,281 tests pass
  • Updated test assertions to use JsonNode.DeepEquals for better comparison

Public API

  • Updated PublicAPI.approved.txt with new members

Performance

  • Updated benchmark results

Verified Behavior

The implementation correctly handles:

  1. V3.2: Uses native deprecated field per spec
  2. V3.1/V3.0: Uses x-oai- prefix extension for backward compatibility
  3. V2.0: Omits deprecated field (not supported in V2)
  4. Default value: Field is omitted when false (only serialized when true)
  5. Forward compatibility: V3.1 deserializer accepts both extension and native field
Original prompt

This section details on the original issue you should resolve

<issue_title>SecurityScheme - new deprecated field</issue_title>
<issue_description>OAI 3.2.0 defines a new deprecated field (bool)

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

For OpenAPi 3.1.0 serialization, we should use a x-oai- prefix to make it an extension</issue_description>

<agent_instructions>Make sure to update the public api export file.</agent_instructions>

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

Fixes #15

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

Copilot AI and others added 2 commits September 30, 2025 01:14
…ization

Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] SecurityScheme - new deprecated field Add deprecated field to SecurityScheme for OpenAPI 3.2.0 Sep 30, 2025
@Copilot Copilot AI requested a review from baywet September 30, 2025 01:27
Copilot finished work on behalf of baywet September 30, 2025 01:27
@baywet baywet marked this pull request as ready for review September 30, 2025 13:16
@baywet
Copy link

baywet commented Sep 30, 2025

@copilot run the following commands cd performance/benchmark && dotnet run -c Release -- EmptyModels and commit the results, do nothing else

Copy link
Author

Copilot AI commented Sep 30, 2025

@copilot run the following commands cd performance/benchmark && dotnet run -c Release -- EmptyModels and commit the results, do nothing else

Ran the benchmark command and committed the updated results in 2e42719.

Copilot finished work on behalf of baywet September 30, 2025 13:42
@Copilot Copilot AI requested a review from baywet September 30, 2025 13:42
@baywet baywet enabled auto-merge September 30, 2025 13:48
@baywet baywet force-pushed the copilot/fix-b37e3c64-4c57-4b84-a718-452893b94d3f branch from 2e42719 to 269181b Compare September 30, 2025 17:32
@baywet baywet merged commit 44e1bb8 into feat/oai-3-2-support Sep 30, 2025
6 checks passed
@baywet baywet deleted the copilot/fix-b37e3c64-4c57-4b84-a718-452893b94d3f branch September 30, 2025 17:40
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.

SecurityScheme - new deprecated field

3 participants