You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer implementing a CommonGrants API, I want to run a command that checks whether a given API matches an OpenAPI spec, so that I can catch inconsistencies between the spec and the implementation.
Developer experience
cg check api <url-for-root-of-the-api><path-to-typespec-or-open-api-spec>
Additional Features
Allow selecting the HTTP client for validation (e.g., curl, httpx).
Provide an option to generate a report (--report json or --report html).
Support authentication with --auth flag for APIs requiring credentials.
Example Usage
# Validate a running API against a spec
cg check api https://api.example.com grants-api.yaml
# Validate using a different HTTP client
cg check api https://api.example.com grants-api.yaml --client httpx
# Validate an authenticated API
cg check api https://api.example.com grants-api.yaml --auth bearer:mytoken
# Generate a validation report in JSON format
cg check api https://api.example.com grants-api.yaml --report json
Technical details
This command should leverage existing tools that validate OpenAPI spec implementations, where possible.
Activity
@common-grants/clifor usability tests #40[-][CLI] validating a commongrants api implementation[/-][+][CLI] Create `cg check api` command[/+]@common-grants/clifor usability tests #40