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

fixed missing tags in expanded spec #1369

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

max107
Copy link
Contributor

@max107 max107 commented Dec 17, 2024

Исправления для expand:

  • Прокинуты tags в спецификацию и операции
  • Использована оригинальная информация из info

@@ -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) {
Copy link
Member

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.

Copy link
Contributor Author

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. Оправдан ли такой подход?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Фактически, мы создаем копию спеки, чтобы мутировать ее, но не потерять при этом остальные данные.

Copy link
Contributor Author

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"`
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Добавил версию только с тегами #1370

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