openservicebrokerapi / servicebroker

Open Service Broker API Specification
https://openservicebrokerapi.org/
Apache License 2.0
1.2k stars 435 forks source link

Remove unsupported OpenAPI spec reference to JSON Schema #735

Closed rsampaio closed 3 years ago

rsampaio commented 3 years ago

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:

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[bot] commented 3 years ago

CLA Signed

The committers are authorized under a signed CLA.

Samze commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

@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?