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

OpenAPI schema validation #94

Open
wilsonianb opened this issue Jan 3, 2024 · 0 comments
Open

OpenAPI schema validation #94

wilsonianb opened this issue Jan 3, 2024 · 0 comments

Comments

@wilsonianb
Copy link
Contributor

Afaict the OpenAPI schemas were previously validated via

but this was removed in 949a177

Should swagger-cli and openapi-format be re-added?
I've alternatively used @stoplight/spectral-cli (and prettier) before:
https://github.com/interledger/open-payments/blob/main/.github/workflows/validate-openapi.yaml

~/agent-protocol$ npx @stoplight/spectral-cli lint schemas/openapi.yml

/home/brandon/agent-protocol/schemas/openapi.yml
   2:6   warning  info-contact               Info object must have "contact" object.                        info
  11:10  warning  operation-description      Operation "description" must be present and non-empty string.  paths./ap/v1/agent/tasks.post
  35:11  warning  operation-tag-defined      Operation tags must be defined in global tags.                 paths./ap/v1/agent/tasks.post.tags[0]
  36:9   warning  operation-description      Operation "description" must be present and non-empty string.  paths./ap/v1/agent/tasks.get
  70:11  warning  operation-tag-defined      Operation tags must be defined in global tags.                 paths./ap/v1/agent/tasks.get.tags[0]
  72:9   warning  operation-description      Operation "description" must be present and non-empty string.  paths./ap/v1/agent/tasks/{task_id}.get
  98:11  warning  operation-tag-defined      Operation tags must be defined in global tags.                 paths./ap/v1/agent/tasks/{task_id}.get.tags[0]
  100:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./ap/v1/agent/tasks/{task_id}/steps.get
 146:11  warning  operation-tag-defined      Operation tags must be defined in global tags.                 paths./ap/v1/agent/tasks/{task_id}/steps.get.tags[0]
 147:10  warning  operation-description      Operation "description" must be present and non-empty string.  paths./ap/v1/agent/tasks/{task_id}/steps.post
 184:11  warning  operation-tag-defined      Operation tags must be defined in global tags.                 paths./ap/v1/agent/tasks/{task_id}/steps.post.tags[0]
  186:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./ap/v1/agent/tasks/{task_id}/steps/{step_id}.get
 224:11  warning  operation-tag-defined      Operation tags must be defined in global tags.                 paths./ap/v1/agent/tasks/{task_id}/steps/{step_id}.get.tags[0]
  226:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./ap/v1/agent/tasks/{task_id}/artifacts.get
 272:11  warning  operation-tag-defined      Operation tags must be defined in global tags.                 paths./ap/v1/agent/tasks/{task_id}/artifacts.get.tags[0]
 273:10  warning  operation-description      Operation "description" must be present and non-empty string.  paths./ap/v1/agent/tasks/{task_id}/artifacts.post
 304:11  warning  operation-tag-defined      Operation tags must be defined in global tags.                 paths./ap/v1/agent/tasks/{task_id}/artifacts.post.tags[0]
  306:9  warning  operation-description      Operation "description" must be present and non-empty string.  paths./ap/v1/agent/tasks/{task_id}/artifacts/{artifact_id}.get
 340:11  warning  operation-tag-defined      Operation tags must be defined in global tags.                 paths./ap/v1/agent/tasks/{task_id}/artifacts/{artifact_id}.get.tags[0]
 406:16    error  oas3-valid-schema-example  "example" property type must be object                         components.schemas.TaskInput.example
 454:16    error  oas3-valid-schema-example  "example" property type must be object                         components.schemas.StepInput.example
 461:16    error  oas3-valid-schema-example  "example" property type must be object,null                    components.schemas.StepOutput.example
 497:19    error  oas3-valid-schema-example  "0" property type must be object                               components.schemas.Task.allOf[1].properties.artifacts.example[0]

✖ 23 problems (4 errors, 19 warnings, 0 infos, 0 hints)
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

No branches or pull requests

1 participant