Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unsupported OpenAPI spec reference to JSON Schema #735

Merged
merged 3 commits into from
May 24, 2021

Conversation

rsampaio
Copy link
Contributor

What is the problem this PR solves?

Remove the JSON Schema reference from the field and turn it into an object like the swagger file.
Adds required tags and an _ to one of the states since spaces are not supported by OpenAPI when the field is an enum so the spec passes validation from tools like gnostic or openapi-generator.

Checklist:

  • The swagger.yaml doc has been updated with any required changes
  • The openapi.yaml doc has been updated with any required changes

Fixes #734

After applying this changes openapi can generate bindings for any language without any issue:

openapi-generator generate -g protobuf-schema -i openapi.yaml -o protobuf
[main] INFO  o.o.codegen.DefaultGenerator - Generating with dryRun=false
[main] WARN  o.o.c.ignore.CodegenIgnoreProcessor - Output directory does not exist, or is inaccessible. No file (.openapi-generator-ignore) will be evaluated.
[main] INFO  o.o.codegen.DefaultGenerator - OpenAPI Generator: protobuf-schema (config)
[main] INFO  o.o.codegen.DefaultGenerator - Generator 'protobuf-schema' is considered beta.
[main] INFO  o.o.codegen.DefaultGenerator - Model Context not generated since it's a free-form object
[main] INFO  o.o.codegen.DefaultGenerator - Model Metadata not generated since it's a free-form object
[main] INFO  o.o.codegen.DefaultGenerator - Model Object not generated since it's a free-form object
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/async_operation.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/catalog.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/dashboard_client.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/error.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/last_operation_resource.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/maintenance_info.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/plan.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/schemas.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_binding_endpoint.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_binding_metadata.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_binding_request.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_binding_resouce_object.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_binding_resource.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_binding_response.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_binding_schema.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_binding_volume_mount.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_binding_volume_mount_device.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_instance_async_operation.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_instance_metadata.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_instance_previous_values.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_instance_provision_request_body.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_instance_provision_response.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_instance_resource.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_instance_schema.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_instance_schema_create.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/models/service_instance_update_request_body.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/services/catalog_service.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/services/service_bindings_service.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/services/service_instances_service.proto
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/README.md
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/.openapi-generator-ignore
[main] INFO  o.o.codegen.AbstractGenerator - writing file /Users/rvaz/Code/servicebroker/protobuf/.openapi-generator/VERSION

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 19, 2021

CLA Signed

The committers are authorized under a signed CLA.

@Samze
Copy link
Contributor

Samze commented Jan 19, 2021

As per the conversation on the bi-weekly call today, the in_progress change here might be problematic as the spec includes the space, so in progress is accurate as the enum field. The rest LGTM.

@rsampaio
Copy link
Contributor Author

@Samze after reading the OpenAPI specification I figured we could change the value of the enum to a string and that would be enough to satisfy the generator, I pushed the change to this branch and now the values are the same as before and correctly interpreted by the generator. I'm looking into the CLA issue today.

@rsampaio rsampaio changed the title Remove unsupported OpenAPI reference and fix naming issue Remove unsupported OpenAPI spec reference to JSON Schema Feb 16, 2021
@rsampaio
Copy link
Contributor Author

@Samze I believe the CLA is authorized but I can't load the EasyCLA page to confirm that, are you able to verify and maybe re-run the validation?

@rsampaio rsampaio force-pushed the rsampaio-openapi-fixes branch from cb29764 to 43f0304 Compare April 13, 2021 14:35
@Samze Samze self-requested a review April 13, 2021 15:54
Copy link
Contributor

@Samze Samze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@gberche-orange gberche-orange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, however I'm not an approver on the project

@Samze Samze requested a review from avilupu May 11, 2021 15:31
@Samze Samze merged commit 45c50bb into openservicebrokerapi:master May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenAPI spec points to unsupported JSON schema definition
5 participants