Repository navigation
Make the OpenAPI document say what each operation answers (B07) - #21
Closed
AsyncAssassin wants to merge 1 commit into
Closed
AsyncAssassin wants to merge 1 commit into
AsyncAssassin wants to merge 1 commit into
Conversation
Swagger is what a reviewer opens first, and it said 200 for every operation, although creations answer 201, sync requests 202 with Location, and ingest 201 or 200. It named no error at all, listed the demo chain simulator next to the API, and showed the validation getters isAmountValid, isDirectionValid, and isStatusValid as required request fields. The controllers declare their success codes, and one customizer adds the ProblemDetail errors every operation shares (400, 401, 403, 503) as application/problem+json with a ProblemDetail schema; the operation-specific errors stay in docs/api.md. The document covers /api only and responds in application/json, and the getters are ignored by Jackson, so they leave the schemas.
This was referenced Sep 23, 2026
Owner
Author
|
Combined into #23 together with the other batch-1 fixes, so they merge without a rebase per PR. This description keeps the detailed evidence for its fix. |
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.
Summary
B07 from the merged review of v0.4.0; 0.4.1 is released once all fixes are merged. Swagger is what a reviewer opens first, and its document did not match the API:
200, although creations answer201, both sync requests202withLocation, and ingest201or200;demothe chain simulator appeared next to the API;isAmountValid,isDirectionValid, andisStatusValidas required fields.What changes:
@ApiResponse, including theLocationheader of a new account and of a sync run.OpenApiCustomizeradds the errors every operation shares,400,401,403, and503, asapplication/problem+jsonwith aProblemDetailschema. The operation-specific ones (404,409,415,429) stay indocs/api.mdsection 14 rather than being repeated on every operation, as the review card advised.springdoc.paths-to-match: /api/**keeps the simulator out, anddefault-produces-media-type: application/jsonreplaces*/*for the success bodies.@JsonIgnore, so they leave the schemas. Bean validation still runs them.The README section on OpenAPI and
docs/testing.mddescribe it.CHANGELOG.mdlists it under[Unreleased]→ Fixed.Verification
./gradlew clean check: 275 tests, 0 failures, 2 skipped (the env-gated Alchemy live smoke).OpenApiDocumentIntegrationTestsreads/v3/api-docsunderdemo, sharing the context ofChainSimulatorIntegrationTests:Location;ProblemDetailerrors;/simulatorpath;*Validfield.200on account creation, no customizer, or the amount getter back in the schema each turns a test red.demorun: the document lists the nine/apioperations with201,202,201/200, or200plus400,401,403,503. The request schemas require only the real fields. Swagger UI and/v3/api-docs.yamlstill answer200.This PR and #15 to #20 each add a section under
[Unreleased]inCHANGELOG.md, so each later merge needs a one-file rebase. With #18 it also meets in the imports ofAccountDtos.ktandObservedEventDtos.kt(both add a Jackson annotation import at the same place); that is resolved in the same rebase.