Skip to content
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

Added more tuple sizes for web::Path for OperationModifier impl #379

Merged

Conversation

TobiasDeBruijn
Copy link
Contributor

Hi there,

This PR adds more tuple sizes (8 more), to support more tuple sizes.

Reasoning

Quite simple, I ran into the limit of 5, and expect to be using a bit more soon too :)

Backwards compatibility

This PR does not affect backwards compatibility

Thanks.

@TobiasDeBruijn
Copy link
Contributor Author

TobiasDeBruijn commented Jan 14, 2022

Before you merge, something weird is going on. The following signature:

#[api_v2_operation]
pub async fn update(data: web::Data<Arc<AppData>>,
    web::Path((organization_id, location_id, room_id, controller_id, sensor_id, alert_id)): web::Path<(i32, i32, i32, i32, i32, i32)>,
    payload: web::Json<UpdateAlert>,
    session: Session
) -> Result<Empty>

generates the following YAML (Converted by editor.swagger.io from the original JSON):

      parameters:
        - in: path
          name: ''
          required: true
          type: integer
          format: int32
        - in: path
          name: organization_id
          required: true
          type: integer
          format: int32
        - in: path
          name: location_id
          required: true
          type: integer
          format: int32
        - in: path
          name: room_id
          required: true
          type: integer
          format: int32
        - in: path
          name: controller_id
          required: true
          type: integer
          format: int32
        - in: path
          name: sensor_id
          required: true
          type: integer
          format: int32

What happened to 'alert_id` here (and why?), and why is the first param empty?

Edit: Nope nevermind. That is my own stupidity. The path in the route() call elsewhere did not include the alert_id parameter. Good to merge then.

@tiagolobocastro tiagolobocastro merged commit 3acc864 into paperclip-rs:master Jan 14, 2022
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.

2 participants