Skip to content

Add better support for locale when using "new OpenAPI()" #1360

Closed
@ianwallen

Description

@ianwallen

Is your feature request related to a problem? Please describe.
Trying to create a new locale application where we are creating the OpenAPI (new OpenAPI().info(new Info()..) as a new object instead of using annotations (@OpenAPIDefinition(info = @Info(...)

It was noticed that data from @OpenAPIDefinition is translated however data from new OpenAPI() is not translated when the locale changes.

It is not known if there already exists a way to have i8n support when using new OpenAPI()?

Describe the solution you'd like
Since it is difficult to apply logic within annotations values, if the api title or version or url needs to be provided at runtime then the logic needs to be applied using the new OpenAPI(). It would be nice if there was support for i8n when creating a new OpenAPI() object.

I don't know how this would need to be implemented?

Describe alternatives you've considered

  • I can't think of any other solution.

Additional context
I have created a unit test app171b in the following branch that shows a case where the locale fails.
https://github.com/ianwallen/springdoc-openapi/tree/locale_non_annotated_issue

Based on how the new feature is implemented, the unit test would need to be changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions