sawtooth-core icon indicating copy to clipboard operation
sawtooth-core copied to clipboard

Add general purpose filter query parameters to REST API

Open peterschwarz opened this issue 3 years ago • 0 comments

On routes that return lists of resources, if there is a query parameter that doesn't match any other parameters, the REST API should assume it is a filter, and only return resources that match that filter.

For example:

/batches?batcher_pubkey=02d260a46457a064733153e09840c322bee1dff34445d7d49e19e60abd18fd0758

Should only return batches with a batcher_pubkey that matches "02d260a46457a064733153e09840c322bee1dff34445d7d49e19e60abd18fd0758".

Features:

  • Comma separated values behave as a logical
  • Dot nation can be used to reference nested keys or indexes
  • header. can be omitted from the beginning of header keys

(Duplicated by https://jira.hyperledger.org/projects/STL/issues/STL-224)

peterschwarz avatar Mar 01 '21 21:03 peterschwarz