--- id: debugging title: Debugging --- ## Generation As a user there may be times when generated outputs don't match your expectations it's unclear why. The CLI supports a `--dry-run` option which may be used to inspect the anticipated file operations without making changes to the file system. Suppose you generate using the `--minimal-update` option, and you notice on subsequent generations of a client that no files have changed. This is by design. For example, if you generate the aspnetcore generator passing `--minimal-update --dry-run` to the sample generation script in the code repository: ```bash export JAVA_OPTS="-Dlog.level=off" ./bin/generate-samples.sh ./bin/configs/lua.yaml -- --minimal-update --dry-run ``` You'll see the output similar to the following: ```bash $ ./bin/generate-samples.sh ./bin/configs/lua.yaml -- --minimal-update --dry-run # START SCRIPT: ./bin/generate-samples.sh This script generates all configs under bin/configs by default. You may generate a targeted script or set of scripts using glob patterns. For example: ./bin/generate-samples.sh bin/configs/java-* You may generate a single config with additional options if you use -- to separate the single config file from the generator arguments. For example: ./bin/generate-samples.sh bin/configs/java-vertx.yaml -- --global-property debugModels=true [main] INFO o.o.codegen.DefaultGenerator - Generating with dryRun=true [main] INFO o.o.codegen.DefaultGenerator - OpenAPI Generator: lua (client) [main] INFO o.o.codegen.DefaultGenerator - Generator 'lua' is considered beta. [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] INFO o.o.codegen.DefaultGenerator - Model inline_object (marked as unused due to form parameters) is generated due to the system property skipFormModel=false (default) [main] INFO o.o.codegen.DefaultGenerator - Model inline_object_1 (marked as unused due to form parameters) is generated due to the system property skipFormModel=false (default) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json) [main] WARN o.o.codegen.DefaultCodegen - Multiple MediaTypes found, using only the first one [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/json) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] WARN o.o.codegen.utils.ModelUtils - Multiple schemas found in the OAS 'content' section, returning only the first one (application/xml) [main] ERROR o.o.codegen.DefaultGenerator - Dry Run Results: k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/.openapi-generator-ignore n /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/.openapi-generator/VERSION k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/api_response_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/category_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/inline_object_1_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/inline_object_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/order_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/pet_api_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/pet_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/store_api_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/tag_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/user_api_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/user_spec.lua States: - w Write - n Write if New/Updated - i Ignored - s Skipped Overwrite - k Skipped by user option(s) - e Error evaluating file write state [main] ERROR o.o.codegen.DefaultGenerator - Dry Run Results: k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/.openapi-generator-ignore n /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/.openapi-generator/VERSION k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/api_response_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/category_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/inline_object_1_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/inline_object_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/order_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/pet_api_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/pet_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/store_api_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/tag_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/user_api_spec.lua k /Users/williamcheng/Code/openapi-generator/samples/client/petstore/lua/spec/user_spec.lua States: - w Write - n Write if New/Updated - i Ignored - s Skipped Overwrite - k Skipped by user option(s) - e Error evaluating file write state ``` The output lists the files which would be written in a normal run of the tool. Notice that we skip `.openapi-generator-ignore` because the file exists and we don't want to blow away the user's generation rules. Most of these files will overwrite output files only if the contents slated for write are different from those on the filesystem; this is denoted by an `n` preceding the filename. Some of the above lines begin with a `w`, meaning these files will _always_ result in a write operation. If you find an operation that you feel should result in a different state, please [open an issue](https://github.com/OpenAPITools/openapi-generator/issues/new/choose) or [submit a pull request](https://github.com/OpenAPITools/openapi-generator/compare) to change the behavior (we welcome all contributions). ## Templates Sometimes, you may have issues with variables in your templates. As discussed in the [templating](./templating.md) docs, we offer a variety of system properties for inspecting the models bound to templates.
--global-property debugOpenAPI
--global-property debugModels
--global-property debugOperations
--global-property debugSupportingFiles