Skip to content
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 vendor extension support to Content.Encoding type #405

Conversation

ayushshrivastv
Copy link
Contributor

Issue #315

This PR adds vendor extension support to the Content.Encoding type, addressing issue #315. The implementation follows the existing patterns used throughout the codebase for vendor extensions.

Changes made:

  • Added VendorExtendable protocol conformance to Content.Encoding
  • Introduced vendorExtensions property to store custom extensions
  • Updated initializers to support optional vendor extensions
  • Modified CodingKeys to properly handle vendor extension encoding/decoding
  • Added comprehensive test cases for both encoding and decoding of vendor extensions

The changes are non-breaking as they:

  • Maintain backward compatibility with existing code
  • Make vendorExtensions parameter optional with a default empty dictionary
  • Preserve all existing functionality

I've implemented these changes in both OpenAPIKit and OpenAPIKit30 to maintain consistency across versions. All tests are passing, including the new vendor extension test cases.

This enhancement allows users to add custom vendor extensions to Content.Encoding objects, following the OpenAPI specification's vendor extension pattern (x-prefixed properties).

…endable conformance, vendorExtensions property, update initializers and CodingKeys, add tests for both OpenAPIKit and OpenAPIKit30
@mattpolzin mattpolzin self-requested a review April 6, 2025 14:14
@mattpolzin mattpolzin merged commit 7706507 into mattpolzin:main Apr 8, 2025
25 checks passed
@mattpolzin
Copy link
Owner

Thanks!

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.

2 participants