Open aSapien opened 5 years ago
@aSapien Seems like the spec contains validation errors:
$ swagger-cli validate https://raw.githubusercontent.com/opsgenie/opsgenie-oas/master/swagger.json
Swagger schema validation failed.
Additional properties not allowed: nullable at #/definitions/EscalationRepeat/properties/closeAlertAfterAll
JSON_OBJECT_VALIDATION_FAILED
After the spec has been updated to address the validation issue, you may also want to try OpenAPI Generator to generate the clients, e.g.
npm install @openapitools/openapi-generator-cli -g
openapi-generator generate -i https://raw.githubusercontent.com/opsgenie/opsgenie-oas/master/swagger.json -g scala-httpclient-deprecated -o /tmp/scala
Try with swagger-codegen v2.4.14
. The cause of the most part of the problems is that the swagger specification is not correctly adapted to swagger: 2.0
. It is mixed with the openapi:3.0.x
specification :(
It should be fixed on https://github.com/opsgenie/opsgenie-oas/pull/53 :P
Steps to reproduce:
Run
swagger-codegen generate -i https://raw.githubusercontent.com/opsgenie/opsgenie-oas/master/swagger.json -l scala -o ./ogswagger/
Result:
Outputs the content of
swagger.json
to stdout and appends the following at the end:I've tried using the same config as in the pom.xml with the following command, but got the same result:
swagger-codegen generate -c ./config.json --invoker-package com.opsgenie.oas.sdk --api-package com.opsgenie.oas.sdk.api --model-package com.opsgenie.oas.sdk.model -i ./swagger.json -l scala --output ./
Please assist 🙏