Skip to content

CLOUDP-325047: add support for extension in the main element of the OAS #773

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

Merged
merged 1 commit into from
Jun 16, 2025

Conversation

andreaangiolillo
Copy link
Collaborator

@andreaangiolillo andreaangiolillo commented Jun 16, 2025

Proposed changes

CLOUDP-325047:

Related to https://github.com/10gen/mms/pull/131979, bump recently added support for a custom extension. Here I am adding the support for extensions to the struct we use to represent an open api spec.

@andreaangiolillo andreaangiolillo marked this pull request as ready for review June 16, 2025 12:28
@andreaangiolillo andreaangiolillo requested a review from a team as a code owner June 16, 2025 12:28
Copy link
Collaborator

@gssbzn gssbzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -34,6 +34,7 @@ type Spec struct {
Paths *openapi3.Paths `json:"paths" yaml:"paths"`
Components *openapi3.Components `json:"components,omitempty" yaml:"components,omitempty"`
ExternalDocs *openapi3.ExternalDocs `json:"externalDocs,omitempty" yaml:"externalDocs,omitempty"`
Extensions map[string]any `json:"-" yaml:"-"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't - means ignored? do you really mean to ignore this field?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I don't want to have the field name extensions in the serializated output. I am reusing the same definition in openapi3.go. It should work since we use the same definition also for Extensions fields in other structs. Btw, I will open a follow up PR to fix this if I am wrong.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right, this does not work. I am adding the missing part here #774

@andreaangiolillo andreaangiolillo merged commit 65d39c9 into main Jun 16, 2025
10 checks passed
@andreaangiolillo andreaangiolillo deleted the CLOUDP-325047 branch June 16, 2025 13:07
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