[BUG] spaces in schema.title causes spaces in interface
Created by: snebjorn
Description
When a response title is set and have spaces then the resulting model will also have spaces. Which is not allowed.
export interface Collection of Foo {
value?: Array<NAMESPACEFoo>;
}
The definition for schema.title
are taken directly from the JSON Schema definition and follow the same specifications
4.5. Root schema and subschemas
The root schema is the schema that comprises the entire JSON document in question.
Some keywords take schemas themselves, allowing JSON Schemas to be nested:
{ "title": "root", "items": { "title": "array item" } }
In this example document, the schema titled "array item" is a subschema, and the schema titled "root" is the root schema.
So spaces in title is valid.
openapi-generator version
"@openapitools/openapi-generator-cli": "^1.0.1-4.1.3"
... yes the version is 1.0.1-4.1.3
it's not a range - it's a bit weird.
Check https://www.npmjs.com/package/@openapitools/openapi-generator-cli
OpenAPI declaration file content or url
{
"openapi": "3.0.0",
"info": {
"title": "Foo",
"version": "0001",
"description": "The description"
},
"paths": {
"/FooSet": {
"get": {
"summary": "Get entities from FooSet",
"responses": {
"200": {
"description": "Retrieved entities",
"content": {
"application/json": {
"schema": {
"title": "Collection of Foo",
"type": "object",
"properties": {
"value": {
"type": "array",
"items": { "$ref": "#/components/schemas/NAMESPACE.Foo" }
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"NAMESPACE.Foo": {
"type": "object",
"properties": {
"id": { "type": "string", "maxLength": 12 }
},
"title": "Foo"
}
}
}
}
Command line used for generation
npx openapi-generator generate -g typescript-angular -i openapi.json -o out/test
Steps to reproduce
Generate a client that have a space in paths["/endpoint"].get.responses.200.content.application/json.schema.title