Additionally, here's a list of issues I've encountered during the conversion process from OpenAPI2 (Swagger) to Protocol Buffers Version 3 for TRS. This does not include issues involving the tools used to convert between them.
enum GetToolsIdVersionsVersion_idDescriptorRelative_pathRequest_Type {
GETTOOLSIDVERSIONSVERSION_IDDESCRIPTORRELATIVE_PATHREQUEST_TYPE_CWL = 0;
GETTOOLSIDVERSIONSVERSION_IDDESCRIPTORRELATIVE_PATHREQUEST_TYPE_WDL = 1;
GETTOOLSIDVERSIONSVERSION_IDDESCRIPTORRELATIVE_PATHREQUEST_TYPE_PLAIN_CWL = 2;
GETTOOLSIDVERSIONSVERSION_IDDESCRIPTORRELATIVE_PATHREQUEST_TYPE_PLAIN_WDL = 3;
}
instead of the expected:
enum DescriptorRequestType {
CWL = 0;
WDL = 1;
PLAIN_CWL = 2;
PLAIN_WDL = 3;
}
Additional notes for OpenAPI3 (not that important):
- Error HTTP responses
Not sure if it's a design decision or a limitation, but there's currently no way to define specific HTTP responses with an expected JSON schema in Protocol Buffers. There's only 1 response defined but no clear indicator which response code that this is for (whether it is 200, 204, 404, etc). It's assumed to be the most common successful response. This issue currently affects the 4 endpoints that do have an error response in OpenAPI2 (Swagger):An example how swagger defines it: https://github.com/ga4gh/tool-registry-schemas/blob/develop/src/main/resources/swagger/ga4gh-tool-discovery.yaml#L170-L173
- /api/ga4gh/v1/tools/{id}/versions/{version-id}/dockerfile
- /api/ga4gh/v1/tools/{id}/versions/{version-id}/{type}/descriptor
- /api/ga4gh/v1/tools/{id}/versions/{version-id}/{type}/descriptor/{relative-path}
- /api/ga4gh/v1/tools/{id}/versions/{version-id}/{type}/tests
- Header information
Protobuf does not specify any header information such as content-type or even things like next_page, last_page, offset, etc. It is likely a limitation with protobuf. This currently affects /api/ga4gh/v1/tools
- Protobuf 3 does not allow 2 enums with properties that are present in both to be defined in the global scope. Currently we may have two enums in Swagger
- DescriptorType
- CWL
- WDL
- DescriptorRequestType
- CWL
- WDL
- PLAIN_CWL
- PLAIN_WDL
- Since CWL and WDL are both present in both enums, this is not valid in protobuf. An error appears: Note that enum values use C++ scoping rules, meaning that enum values are siblings of their type, not children of it. Therefore, "CWL" must be unique within "GA4GH", not just within "DescriptorRequestType".
This means when a Swagger.yaml with these 2 enums are converted into protobuf with Openapi2proto, a prefix will be prepended onto the enums so it will not conflict. Currently it gets converted to something like this:enum GetToolsIdVersionsVersion_idDescriptorRelative_pathRequest_Type {
GETTOOLSIDVERSIONSVERSION_IDDESCRIPTORRELATIVE_PATHREQUEST_TYPE_CWL = 0;
GETTOOLSIDVERSIONSVERSION_IDDESCRIPTORRELATIVE_PATHREQUEST_TYPE_WDL = 1;
GETTOOLSIDVERSIONSVERSION_IDDESCRIPTORRELATIVE_PATHREQUEST_TYPE_PLAIN_CWL = 2;
GETTOOLSIDVERSIONSVERSION_IDDESCRIPTORRELATIVE_PATHREQUEST_TYPE_PLAIN_WDL = 3;
}
instead of the expected:
enum DescriptorRequestType {
CWL = 0;
WDL = 1;
PLAIN_CWL = 2;
PLAIN_WDL = 3;
}
enum DescriptorRequestType {
CWL = 0;
WDL = 1;
PLAIN_CWL = 2;
PLAIN_WDL = 3;
}enum DescriptorType {
CWL = 0;
WDL = 1;
}No apologies needed, we're specifically asking for some useful resources from protobuf experts.
Between our experience with OpenAPI/Swagger and the effort in the TES repo https://github.com/ga4gh/task-execution-schemas/pull/97 we should be able to work out something consistent.
--
You received this message because you are subscribed to the Google Groups "GA4GH Cloud Technical Work Stream" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ga4gh-cloud+unsubscribe@genomicsandhealth.org.
To unsubscribe from this group and stop receiving emails from it, send an email to ga4gh-cloud...@genomicsandhealth.org.
+1
To unsubscribe from this group and stop receiving emails from it, send an email to ga4gh-cloud+unsubscribe@genomicsandhealth.org.
+1
To unsubscribe from this group and stop receiving emails from it, send an email to ga4gh-cloud...@genomicsandhealth.org.
--
You received this message because you are subscribed to the Google Groups "GA4GH Cloud Technical Work Stream" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ga4gh-cloud...@genomicsandhealth.org.
--
You received this message because you are subscribed to the Google Groups "GA4GH Cloud Technical Work Stream" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ga4gh-cloud...@genomicsandhealth.org.