StackStorm / st2

StackStorm (aka "IFTTT for Ops") is event-driven automation for auto-remediation, incident responses, troubleshooting, deployments, and more for DevOps and SREs. Includes rules engine, workflow, 160 integration packs with 6000+ actions (see https://exchange.stackstorm.org) and ChatOps. Installer at https://docs.stackstorm.com/install/index.html
https://stackstorm.com/
Apache License 2.0
6.08k stars 747 forks source link

openapi.yaml not standing in specifications. #5453

Open DavidMeu opened 2 years ago

DavidMeu commented 2 years ago

The openapi.yaml not standing in https://github.com/OAI/OpenAPI-Specification/blob/main/schemas/v2.0/schema.json specifications.

[{\"code\":\"ValidationError\",\"target\":\"representation\",\"message\":\"Parsing error(s): JSON is valid against no schemas from 'oneOf'. Path 'paths['/{connectionId}/api/v1/executions/{id}/result'].get.responses.200', line 806, position 18.\"},{\"code\":\"ValidationError\",\"target\":\"representation\",\"message\":\"Parsing error(s): JSON does not match any schemas from 'anyOf'. Path 'definitions.AliasExecution.properties.actionalias.properties.formats.items', line 1123, position 24.\"},{\"code\":\"ValidationError\",\"target\":\"representation\",\"message\":\"Parsing error(s): Invalid type. Expected Object but got String. Path 'definitions.AliasExecution.properties.execution.properties.$ref', line 1199, position 45.\"},{\"code\":\"ValidationError\",\"target\":\"representation\",\"message\":\"Parsing error(s): Invalid type. Expected Array but got Boolean. Path 'definitions.PacksInstall.properties.skip_dependencies.required', line 1620, position 27.\"},{\"code\":\"ValidationError\",\"target\":\"representation\",\"message\":\"Parsing error(s): The input OpenAPI file is not valid for the OpenAPI specificate https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md (schema https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v2.0/schema.json).\"}]}}","Target":null,"Details":[],"Innererror":null}

Also recieving alot of errors uploading it to: https://editor.swagger.io/

arm4b commented 2 years ago

Thanks for the report. Sounds like a bug indeed.

If you see any low-hanging fruits to fix the validation here and there, - contributions would be very welcome!

DavidMeu commented 2 years ago

@armab I also saw this relevant issue: #4488

I'm not sure from where to start. For example I got:

Semantic error at paths./api/v1/executions/{id}/re_run.post.parameters.1.schema.properties.tasks
Schemas with 'type: array', require a sibling 'items: ' field

For:

              tasks:
                type: array
                default: []

But I'm not sure what type is required for items (In other words what the type the tasks array should contain):

          items:
            type: string

Also not appearing in docs: https://api.stackstorm.com/api/v1/executions/#/action_execution_rerun_controller.post