You can use query options in Swagger to control the amount and order of the data returned in the response:
See the examples below.
- Expand Query Option ($expand)
The '$expand' option allows you to return related entries with a single URI. Entities that it is possible to expand can be seen in the property's Model:
Specify one or several comma-separated properties, then click Execute:
It is possible to use nested '$expand':
- Filter Query Option ($filter)
Use the '$filter' option to return only the items meeting the desired condition:
It is possible to add filter by expanded properties as well:
- Select Query Option ($select)
Specify the separate properties you would like to get in the response:
- Orderby Query Option ($orderby)
Use the '$orderby' option to order the items returned in the response:
It is possible to sort the response by expanded property as well:
- Top Query Option ($top)
Use the '$top' option to return only the first N items of the result:
Note: might be useful when sorting the result with the 'orderby' option:
- Skip Query Option ($skip)
It might be necessary to skip several items returned, especially when sorting the data. Use the '$skip' option for that:
Check OData documentation to find more examples and information.
Comments
Please sign in to leave a comment.