Pagination

To create data filtering on the order-api service, we will expose a new endpoint that retrieves the orders through a GET method. Before we start coding, let's first change the openapi.yml file and add this new operation there:

/store/orders:    get:      tags:        - store      summary: Returns orders      description: Returns the orders      operationId: getOrder      responses:        '200':          description: successful operation          content:            application/json:              schema:                type: object                additionalProperties:                  type: integer                  format: int32        '401':          $ref: '#/components/responses/UnauthorizedError'      security:        - bearerAuth: []

The full openapi.yml file is as follows:

 openapi: 3.0.0servers:# Added by API Auto Mocking Plugin  - description: SwaggerHub API Auto Mocking url: https://virtserver.swaggerhub.com/biharck/hands-on/1.0.0 ...

Get Hands-On RESTful Web Services with TypeScript 3 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.