Skip to content

Fix Swagger discrepancies#58

Closed
0xsemaj wants to merge 3 commits into
mainfrom
swagger-fix
Closed

Fix Swagger discrepancies#58
0xsemaj wants to merge 3 commits into
mainfrom
swagger-fix

Conversation

@0xsemaj

@0xsemaj 0xsemaj commented Feb 20, 2026

Copy link
Copy Markdown
Member

Fix Swagger discrepancies

Summary

  • Changed all four vehicle endpoints (/latest-index-key, /index-keys, /objects, /latest-object) from POST to GET in
    the router registration which was returning 405 Not Allowed previously
  • Replaced the opaque searchParams struct annotation with explicit, individually documented query parameters (id,
    type, source, producer, before, after, limit) across all four handlers
  • Fixed tokenId path parameter type from string to integer in all handler annotations
  • Reordered parameters in the generated Swagger docs so tokenId (path param) appears first, followed by query
    params in a logical order
  • Added @Security BearerAuth annotation to all four endpoints, which was missing and caused the endpoints to appear
    as unauthenticated in the Swagger UI
  • Added descriptions to before (Upper time bound (RFC3339)) and after (Lower time bound (RFC3339)) to clarify their
    expected format

@0xsemaj
0xsemaj requested a review from zer0stars February 20, 2026 18:08
@elffjs

elffjs commented Feb 23, 2026

Copy link
Copy Markdown
Member

The generate linter is failing. This should pass.

@elffjs elffjs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I think I've got the code generation checker set. protobuf is annoying because it's not a Go binary.

I have no idea how the method in the Swagger got out of sync. It's specified once in code and once in a comment so it's surprising that it doesn't happen more often.

I am worried that someone—maybe even one of our services—is going to rely on the old behavior and that it's going to hurt us. Let's find out.

@elffjs

elffjs commented Feb 23, 2026

Copy link
Copy Markdown
Member

Okay I just checked nginx logs and no one is calling this. Very free.

@0xsemaj

0xsemaj commented Feb 24, 2026

Copy link
Copy Markdown
Member Author

Don't think we need this pr anymore now that we're on graphQL

@zer0stars zer0stars closed this Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants