swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
16.72k stars 6.02k forks source link

Invalid anonymous model name with non-ascii title #12389

Open inferrna opened 1 month ago

inferrna commented 1 month ago
Example swagger. See broken property ```yaml openapi: 3.0.0 servers: - url: 'https://todo.vacs.fr/v1' - url: 'http://todo.vacs.fr/v1' info: title: Todo API description: Todo API version: 1.0.0 termsOfService: 'https://todo.vacs.fr/terms/' contact: email: Stephane.Carrez@gmail.com license: name: Apache 2.0 url: 'http://www.apache.org/licenses/LICENSE-2.0.html' tags: - name: tasks description: Tasks paths: /: get: tags: - tasks summary: Redirect to the UI description: | Default operation to redirect to the UI index page. operationId: redirectTodos responses: '302': description: redirect to the UI page /todos: get: tags: - tasks summary: List the available tasks description: | The list of tasks can be filtered by their status. operationId: listTodos parameters: - name: status in: query description: Filters the tasks by their status required: false schema: type: string enum: - done - waiting - working - all responses: '200': description: successful operation content: application/json: schema: type: array items: $ref: '#/components/schemas/Todo' '400': description: Invalid status value security: - todo_auth: - 'read:todo' security: - todo_auth: [] externalDocs: description: Find out more about Swagger url: 'http://swagger.io' components: securitySchemes: todo_auth: type: oauth2 flows: password: tokenUrl: 'http://localhost:8080/v1/oauth/token' scopes: 'write:todo': Write a todo 'read:todo': Read a todo schemas: Todo: type: object properties: broken: type: object title: "приветики" properties: testprop: type: integer id: type: integer format: int64 description: The todo identifier title: type: string description: The todo title create_date: type: string format: date-time description: The todo creation date done_date: type: string format: date-time description: The todo resolution date status: type: string description: The todo state enum: - waiting - working - done required: - id - title - status - create_date example: id: 23 title: Make the FOSDEM presentation description: password status: working create_date: '2017-12-24T00:00:00.000Z' xml: name: Todo ```

Without title, broken field is naming as TodoBroken.scala, with ascii title it's naming after it. But with any non-ascii title, it just empty.