You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use the openapi-generator-cli to generate a Go client from the API specification generated from the API at /api/swagger.json, I get the following validation errors and nothing is generated by the CLI:
docker run --rm \
-v "./logto-client:/local" \
openapitools/openapi-generator-cli generate \
-i http://<ip-address>:3002/api/swagger.json \ # This is the IP address and port that is visible to the container
-g go \
--package-name logto \
-p withGoMod=false \
-p goImportAlias=logto \
-o /local/
See validation errors
Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
| Error count: 18, Warning count: 0
Errors:
-components.parameters.Parameter name factoryId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name resourceId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name applicationId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name ssoConnectorId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name connectorFactoryId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name organizationScopeId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name organizationInvitationId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name connectorId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name scopeId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name logId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name roleId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name keyId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name organizationId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name verificationId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name organizationRoleId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name userId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name hookId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
-components.parameters.Parameter name domainId:root doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$
at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:717)
at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:744)
at org.openapitools.codegen.cmd.Generate.execute(Generate.java:527)
at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)
If I use the suggested fix and use the --skip-validate-spec flag, I still see the errors, but the code will be generated. However, the generated code is invalid and doesn't compile. I initially thought that there is a problem with the Go extension of the openapi-generator-cli, but then I used the Swagger Editor and found out that the OpenAPI spec file is actually invalid.
Expected behavior
I'd like to see an OpenAPI specification document that complies with the OpenAPI 2/3 standards, so I can generate a client SDK from it.
How to reproduce?
Explained above using Docker, but one can also use the Java (JAR) file (install doc).
Context
Screenshots
The text was updated successfully, but these errors were encountered:
I imported the OpenAPI file into Postman. Then I exported the Postman collection (saved it as a file) and converted it back to OpenAPI using the postman-to-openapi tool. The generated Go client from the converted OpenAPI spec doc is very messy.
Describe the bug
When I use the
openapi-generator-cli
to generate a Go client from the API specification generated from the API at/api/swagger.json
, I get the following validation errors and nothing is generated by the CLI:See validation errors
If I use the suggested fix and use the
--skip-validate-spec
flag, I still see the errors, but the code will be generated. However, the generated code is invalid and doesn't compile. I initially thought that there is a problem with the Go extension of theopenapi-generator-cli
, but then I used the Swagger Editor and found out that the OpenAPI spec file is actually invalid.Expected behavior
I'd like to see an OpenAPI specification document that complies with the OpenAPI 2/3 standards, so I can generate a client SDK from it.
How to reproduce?
Explained above using Docker, but one can also use the Java (JAR) file (install doc).
Context
Screenshots
The text was updated successfully, but these errors were encountered: