Skip to content

Commit c91d116

Browse files
authored
feat(config schema): add openapi-normalizer generator property (#830)
1 parent 36aec42 commit c91d116

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

apps/generator-cli/src/config.schema.json

+62
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,68 @@
384384
}
385385
]
386386
},
387+
"openapi-normalizer": {
388+
"description": "OpenAPI Normalizer transforms the input OpenAPI doc/spec (which may not perfectly conform to the specification) to make it workable with OpenAPI Generator.",
389+
"type": "object",
390+
"properties": {
391+
"ADD_UNSIGNED_TO_INTEGER_WITH_INVALID_MAX_VALUE": {
392+
"description": "when set to true, auto fix integer with maximum value 4294967295 (2^32-1) or long with 18446744073709551615 (2^64-1) by adding x-unsigned to the schema",
393+
"type": "boolean"
394+
},
395+
"FILTER": {
396+
"description": "When set to operationId:addPet|getPetById for example, it will add x-internal:true to operations with operationId not equal to addPet/getPetById (which will have x-internal set to false) so that these operations marked as internal won't be generated",
397+
"type": "string"
398+
},
399+
"KEEP_ONLY_FIRST_TAG_IN_OPERATION": {
400+
"description": "when set to true, only keep the first tag in operation if there are more than one tag defined",
401+
"type": "boolean"
402+
},
403+
"REF_AS_PARENT_IN_ALLOF": {
404+
"description": "when set to true, child schemas in allOf is considered a parent if it's a $ref (instead of inline schema)",
405+
"type": "boolean"
406+
},
407+
"REFACTOR_ALLOF_WITH_PROPERTIES_ONLY": {
408+
"description": "When set to true, refactor schema with allOf and properties in the same level to a schema with allOf only and, the allOf contains a new schema containing the properties in the top level",
409+
"type": "boolean"
410+
},
411+
"REMOVE_ANYOF_ONEOF_AND_KEEP_PROPERTIES_ONLY": {
412+
"description": "when set to true, oneOf/anyOf schema with only required properies only in a schema with properties will be removed",
413+
"type": "boolean"
414+
},
415+
"REMOVE_X_INTERNAL": {
416+
"description": "Set to true if you want to disable the default behavior of removing/hiding the x-internal in operations and model",
417+
"type": "boolean"
418+
},
419+
"SET_CONTAINER_TO_NULLABLE": {
420+
"description": "When set to array|set|map (or just array) for example, it will set nullable in array, set and map to true",
421+
"type": "string"
422+
},
423+
"SET_PRIMITIVE_TYPES_TO_NULLABLE": {
424+
"description": "When set to string|integer|number|boolean (or just string) for example, it will set the type to nullable (nullable: true)",
425+
"type": "string"
426+
},
427+
"SET_TAGS_FOR_ALL_OPERATIONS": {
428+
"description": "when set to a string value, tags in all operations will reset to the string value provided",
429+
"type": "boolean"
430+
},
431+
"SET_TAGS_TO_OPERATIONID": {
432+
"description": "when set to true, tags in all operations will be set to operationId or \"default\" if operationId is empty",
433+
"type": "boolean"
434+
},
435+
"SIMPLIFY_ANYOF_STRING_AND_ENUM_STRING": {
436+
"description": "when set to true, simplify anyOf schema with string and enum of string to just string",
437+
"type": "boolean"
438+
},
439+
"SIMPLIFY_BOOLEAN_ENUM": {
440+
"description": "when set to true, convert boolean enum to just enum",
441+
"type": "boolean"
442+
},
443+
"SIMPLIFY_ONEOF_ANYOF": {
444+
"description": "when set to true, simplify oneOf/anyOf by 1) removing null (sub-schema) or enum of null (sub-schema) and setting nullable to true instead, and 2) simplifying oneOf/anyOf with a single sub-schema to just the sub-schema itself",
445+
"type": "boolean"
446+
}
447+
}
448+
},
387449
"packageName": {
388450
"type": "string",
389451
"description": "package for generated classes (where supported)"

0 commit comments

Comments
 (0)