-
Notifications
You must be signed in to change notification settings - Fork 87
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
fixed missing tags in expanded spec #1369
base: main
Are you sure you want to change the base?
Conversation
@@ -15,11 +15,11 @@ import ( | |||
) | |||
|
|||
// Expand generates an expanded ogen.Spec from given api. | |||
func Expand(api *openapi.API) (*ogen.Spec, error) { | |||
func Expand(api *openapi.API, spec *ogen.Spec) (*ogen.Spec, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a breaking change.
Instead, let's add tags
to the openapi.API
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tdakkota нужно будет продублировать половину / все структуры ogen.Spec в openapi.Spec, чтобы на выходе получилась снова ogen.Spec. Оправдан ли такой подход?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Фактически, мы создаем копию спеки, чтобы мутировать ее, но не потерять при этом остальные данные.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Для исправления todo нам нужно продублировать структуру Info и все связные с ней
type Info struct {
// REQUIRED. The title of the API.
Title string `json:"title" yaml:"title"`
// A short summary of the API.
Summary string `json:"summary,omitempty" yaml:"summary,omitempty"`
// A short description of the API.
// CommonMark syntax MAY be used for rich text representation.
Description string `json:"description,omitempty" yaml:"description,omitempty"`
// A URL to the Terms of Service for the API. MUST be in the format of a URL.
TermsOfService string `json:"termsOfService,omitempty" yaml:"termsOfService,omitempty"`
// The contact information for the exposed API.
Contact *Contact `json:"contact,omitempty" yaml:"contact,omitempty"`
// The license information for the exposed API.
License *License `json:"license,omitempty" yaml:"license,omitempty"`
// REQUIRED. The version of the OpenAPI document.
Version string `json:"version" yaml:"version"`
// Specification extensions.
Extensions Extensions `json:"-" yaml:",inline"`
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Добавил версию только с тегами #1370
Исправления для expand: