Fix sdxStepTokenApi OpenAPI spec to pass CSIT governance linting - #264
Merged
Conversation
Contributor
Author
|
@ikethecoder attn breaking change, endpoint changed from |
ikethecoder
approved these changes
Apr 15, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Resolves all Spectral lint violations against the CSIT API Governance ruleset.
API changes
POST /token→POST /tokensto satisfy thepath-segments-no-verbs-probablerule (plural noun is correct REST convention for a resource endpoint)New file:
models.pyExtracted Pydantic models from
routes.pyand added OAS 3.1 / governance-compliant annotations:TokenRequestandTokenResponse— addeddescriptionHealthResponse— new typed response model forGET /health(previously returned a raw dict)HTTPValidationError— replaced FastAPI's default schema with an RFC 7807 Problem Details structure (type,title,status,detail,errorswithminItems: 1)ValidationError— restructured error item schema to match the style guide's required shape:type(string),location(enum:body | query | header | path | cookie),code,messageapp.pysummaryand expandeddescriptionon theFastAPI()instanceGET /healthwithoperation_id,description, and a typedresponse_modelRequestValidationErrorhandler to return Problem Details format, mapping Pydantic error fields tolocation/code/messagecustom_openapi()override for two purposes:summaryfields (/tokens,/health) — not natively supported by FastAPI route decoratorsexamplesfor all component schemas with explicit key ordering, bypassing the alphabetical sorting applied by FastAPI's schema pipelineroutes.pyoperation_id="createToken"and explicitresponsesdescriptions for 200 and 422TokenRequest,TokenResponse,HTTPValidationErrorfrommodels.pysdx-ca-token-api-spec.md,README.md,tests/test_routes.py/tokento/tokensTypes of changes
Checklist
Further comments
This took a few rounds working with an AI agent and probably would have been a pain to undertake manually. That said, adding