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

Support additional format of field mask in query parameters #61

Closed
johanstokking opened this issue Jan 29, 2019 · 2 comments
Closed

Support additional format of field mask in query parameters #61

johanstokking opened this issue Jan 29, 2019 · 2 comments
Assignees
Labels
compat/api This could affect API compatibility

Comments

@johanstokking
Copy link
Member

Summary:

At the moment there are two formats to pass the field mask for get requests:

  1. ?field_mask.paths=field1&field_mask.paths=field2
  2. ?field_mask.paths[]=field1&field_mask.paths[]=field2

It might be convenient to introduce the comma-separated version:
?field_mask.paths=field1,field2

Why do we need this?

  • Short and readable endpoints.
  • The process of constructing the url becomes easier

What is already there? What do you see now?

All parameters in the comma-separated format are stored as a single value in the FieldMask.Paths slice.

What is missing? What do you want to see?

Thread every comma-separated field name individually

How do you propose to implement this?

What can you do yourself and what do you need help with?

File the feature request

@htdvisser please fill the milestone


Original issue: https://github.com/TheThingsIndustries/lorawan-stack/issues/1564 by @bafonins

@johanstokking johanstokking added compat/api This could affect API compatibility l/open source labels Jan 29, 2019
@johanstokking johanstokking added this to the Backlog milestone Feb 6, 2019
@kschiffer
Copy link
Contributor

kschiffer commented Feb 26, 2019

From what I see, this issue is resolved, or there is a third option that we overlooked that serves our needs perfectly.
Following formats are possible:

  • ?field_mask.paths=field1&field_mask.paths=field2
  • ?field_mask.paths[]=field1&field_mask.paths[]=field2
  • ?field_mask=field1,field2, easily the most convenient

Tested in the IS device registry.

@htdvisser
Copy link
Contributor

That third option is indeed the best. Seems to be supported by grpc-gateway since grpc-ecosystem/grpc-gateway#529. Not sure why it wasn't working before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compat/api This could affect API compatibility
Projects
None yet
Development

No branches or pull requests

3 participants