OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.91k stars 6.58k forks source link

[REQ] Property requirements/restrictions not included in generated AsciiDoc files #11389

Open lfvjimisola opened 2 years ago

lfvjimisola commented 2 years ago

Is your feature request related to a problem? Please describe.

Property restrictions (maxLength, minLength, etc) should be used included in the generated AsciiDoc file(s).

Describe the solution you'd like

Property requirements/restrictions to generated files.

For relevant requirements/restrictions see: https://swagger.io/specification/#schema-object

Describe alternatives you've considered

We could theoretically add these manually but it's not practical as we want this fully automated.

Additional context

It is unclear whether:

  1. the properties aren't read from openapi.json and available for the template engine (mustaché)
  2. the AsciiDoc template simply has to be updated
lfvjimisola commented 2 years ago

Verified that the model contains JSON Schema including minimum, maximum, minLength, maxLength etc using:

java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generate -t modules/openapi-generator/src/main/resources/asciidoc-documentation -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g asciidoc --global-property debugOperations=true,debugModels=true > ~/model.json

So, the AsciiDoc template that has to be updated. Are there other AsciiDoc templates already perhaps?