Repository navigation
Conversation
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
Adds two README sections that were only in the Swagger description:
UsdcPrecisionValidationMiddlewarechecks, what it accepts and rejects (more than 7 decimals, non-plain-decimal formats,-0), and an example error.Idempotency-Keyon POST/PUT/PATCH, 255-char/line-break validation, 24h caching of 2xx JSON responses,X-Idempotent-Replayed, how concurrent requests behave (wait up to 25s, then409 IDEMPOTENCY_CONFLICT), and Redis fail-open.One commit per issue.
Closes #913
Closes #912
How it was checked
Every statement was written from the current source and checked against it:
src/common/middleware/usdc-precision-validation.middleware.ts,src/common/middleware/idempotency.middleware.ts, and their registration order insrc/main.ts. The new section links point at existing README headings. Docs only; no code, build or tests were run.Two behaviours that follow from the code and are called out in the text: the idempotency cache key is method + path (no query string) + key, so it is not tied to the caller or the request body; and only the request body is checked for precision, not query parameters. If either is not intended, say so and I will reword.
AI disclosure: prepared with an AI coding assistant; I read the middleware source to confirm each statement.