Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add ability to modify the global tags section #22

Merged
merged 4 commits into from
Apr 25, 2022
Merged

Add ability to modify the global tags section #22

merged 4 commits into from
Apr 25, 2022

Conversation

AdrianRaFo
Copy link
Contributor

No description provided.

@alejandrohdezma
Copy link
Owner

👋🏼 That's a great addition, but, what if instead adding an ad-hoc method just for tags, we add a method for allowing customizing the whole OpenAPI object? Something like...

/** Method that can be used to modify the `OpenAPI` object before transforming it to YAML */
def tapirGoldenOpenAPIModifier(openApi: OpenAPI): OpenAPI = openApi

And then use it like:

private def yaml: String = {
  val openAPI = OpenAPIDocsInterpreter(tapirGoldenOpenAPIOptions).toOpenAPI(endpoints, tapirGoldenOpenAPIInfo)

  val yamlString = tapirGoldenOpenAPIModifier(openAPI).toYaml

  tapirGoldenOpenAPIHeader match {
    case ""     => yamlString
    case header => s"$header\n\n$yamlString"
  }
}

@gutiory gutiory added the 🚀 feature New feature or improvement label Apr 25, 2022
@alejandrohdezma alejandrohdezma merged commit 166a32e into alejandrohdezma:main Apr 25, 2022
@alejandrohdezma
Copy link
Owner

This change has been included in 0.3.0 version.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
🚀 feature New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants