Skip to content

Feature: OpenAPI spec syntax validation (--validate flag) #5

@roebi

Description

@roebi

Feature: OpenAPI spec syntax validation (--validate flag)

Current behaviour

apiup fails with a cryptic error if the spec is malformed.
No feedback on whether the spec is valid OpenAPI 3.x.

Desired behaviour

Add --validate flag (and run automatically on startup):

apiup --validate
apiup --validate --spec ./my-api.yaml

Using openapi-spec-validator:
pip install openapi-spec-validator

Output:
✓ spec valid (OpenAPI 3.0.3, 7 routes)
✗ spec invalid:
- paths./skills.get.responses missing required field

Notes

  • openapi-spec-validator is an optional dependency
  • If not installed, warn but don't block startup
  • Add to [project.optional-dependencies] as extras = ["validate"]

Labels

enhancement good first issue

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions