Skip to content

Java/Ruby client gen #727

Open
Open
@pbespechnyi

Description

@pbespechnyi

Hey Linode Team,

I'm trying to generate client based on the openapi spec in this repo, but cli says that spec is invalid (tried java, ruby).

openapi-generator generate -i openapi.yaml -g java -o ./gen
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: 30, Warning count: 2
Errors:
	-attribute components.schemas.DatabasePostgreSQL.status is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQL.updated is not of type `schema`
	-attribute components.schemas.SecurityQuestionsPost.response is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQLRequest.replication_commit_type is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQLRequest.cluster_size is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQLRequest.region is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQLRequest.replication_type is not of type `schema`
	-attribute components.schemas.LKENodePoolRequestBody.count is not of type `schema`
	-attribute components.schemas.LinodeRequest.authorized_users is not of type `schema`
	-attribute components.schemas.LinodeRequest.stackscript_id is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQLRequest.ssl_connection is not of type `schema`
	-attribute components.schemas.DiskRequest.filesystem is not of type `schema`
	-attribute components.schemas.LinodeRequest.stackscript_data is not of type `schema`
	-attribute components.schemas.LinodeRequest.image is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQL.created is not of type `schema`
	-attribute components.schemas.DatabaseMySQL.hosts is not of type `schema`
	-attribute components.schemas.DatabaseMongoDBRequest.storage_engine is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQLRequest.allow_list is not of type `schema`
	-attribute components.schemas.LKENodePoolRequestBody.items is not of type `schema`
	-attribute components.schemas.DatabaseMongoDBRequest.compression_type is not of type `schema`
	-attribute components.schemas.LKENodePoolRequestBody.tags is not of type `schema`
	-attribute components.schemas.DiskRequest.label is not of type `schema`
	-attribute components.schemas.Volume.id is not of type `schema`
	-attribute components.schemas.SecurityQuestionsPost.question is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQLRequest.encrypted is not of type `schema`
	-attribute components.schemas.LinodeRequest.authorized_keys is not of type `schema`
	-attribute components.schemas.LKENodePoolRequestBody.type is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQL.updates is not of type `schema`
	-attribute components.schemas.DatabaseMongoDBRequest.replica_set is not of type `schema`
	-attribute components.schemas.LinodeRequest.root_pass is not of type `schema`
Warnings:
	-attribute components.schemas.DatabasePostgreSQL.status is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQL.updated is not of type `schema`
	-attribute components.schemas.SecurityQuestionsPost.response is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQLRequest.replication_commit_type is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQLRequest.cluster_size is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQLRequest.region is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQLRequest.replication_type is not of type `schema`
	-attribute components.schemas.LKENodePoolRequestBody.count is not of type `schema`
	-attribute components.schemas.LinodeRequest.authorized_users is not of type `schema`
	-attribute components.schemas.LinodeRequest.stackscript_id is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQLRequest.ssl_connection is not of type `schema`
	-attribute components.schemas.DiskRequest.filesystem is not of type `schema`
	-attribute components.schemas.LinodeRequest.stackscript_data is not of type `schema`
	-attribute components.schemas.LinodeRequest.image is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQL.created is not of type `schema`
	-attribute components.schemas.DatabaseMySQL.hosts is not of type `schema`
	-attribute components.schemas.DatabaseMongoDBRequest.storage_engine is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQLRequest.allow_list is not of type `schema`
	-attribute components.schemas.LKENodePoolRequestBody.items is not of type `schema`
	-attribute components.schemas.DatabaseMongoDBRequest.compression_type is not of type `schema`
	-attribute components.schemas.LKENodePoolRequestBody.tags is not of type `schema`
	-attribute components.schemas.DiskRequest.label is not of type `schema`
	-attribute components.schemas.Volume.id is not of type `schema`
	-attribute components.schemas.SecurityQuestionsPost.question is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQLRequest.encrypted is not of type `schema`
	-attribute components.schemas.LinodeRequest.authorized_keys is not of type `schema`
	-attribute components.schemas.LKENodePoolRequestBody.type is not of type `schema`
	-attribute components.schemas.DatabasePostgreSQL.updates is not of type `schema`
	-attribute components.schemas.DatabaseMongoDBRequest.replica_set is not of type `schema`
	-attribute components.schemas.LinodeRequest.root_pass is not of type `schema`

	at org.openapitools.codegen.config.CodegenConfigurator.toContext(CodegenConfigurator.java:604)
	at org.openapitools.codegen.config.CodegenConfigurator.toClientOptInput(CodegenConfigurator.java:631)
	at org.openapitools.codegen.cmd.Generate.execute(Generate.java:457)
	at org.openapitools.codegen.cmd.OpenApiGeneratorCommand.run(OpenApiGeneratorCommand.java:32)
	at org.openapitools.codegen.OpenAPIGenerator.main(OpenAPIGenerator.java:66)

If I disable spec validation, if fails with NPE:

openapi-generator generate -i openapi.yaml -g java -o ./gen --skip-validate-spec

Output: https://gist.github.com/pbespechnyi/fe1df599ae6b8b732a1b6bf48fcbba6a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions