Skip to content

Comments

Fix Swagger discrepancies#58

Closed
jamesliupenn wants to merge 3 commits intomainfrom
swagger-fix
Closed

Fix Swagger discrepancies#58
jamesliupenn wants to merge 3 commits intomainfrom
swagger-fix

Conversation

@jamesliupenn
Copy link
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

@elffjs
Copy link
Member

elffjs commented Feb 23, 2026

The generate linter is failing. This should pass.

Copy link
Member

@elffjs elffjs left a comment

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
Copy link
Member

elffjs commented Feb 23, 2026

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

@jamesliupenn
Copy link
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