- 
                Notifications
    You must be signed in to change notification settings 
- Fork 305
feat(lazer-protocol): add utoipa schema to api types #3168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| The latest updates on your projects. Learn more about Vercel for GitHub. 
 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
        
          
                lazer/sdk/rust/protocol/src/price.rs
              
                Outdated
          
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
  Align schema type with string serialization
The new schema declares Price as #[schema(value_type = i64)], yet ParsedFeedPayload (and other API structs) serialize Price using crate::serde_str::option_price, which converts the value to a string. The OpenAPI specification generated from this derive will advertise an integer while the WebSocket/HTTP payloads actually contain quoted strings, so clients generated from the spec will attempt to parse numbers and fail at runtime. Consider modelling the schema as a string (or overriding the field-level schema) so it matches the serialized representation.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Please update the schema to use crate::serde_str::option_price
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
Summary
utoipa::ToSchematrait to api typesRationale
How has this been tested?