Asymmetrik/node-rest-starter

View on GitHub
src/app/core/core.components.yml

Summary

Maintainability
Test Coverage
components:
  schemas:
    Error:
      type: object
      properties:
        status:
          type: number
        type:
          type: string
        message:
          type: string
    ResultsPage:
      type: object
      properties:
        pageNumber:
          type: integer
        pageSize:
          type: integer
        totalPages:
          type: integer
        totalSize:
          type: integer
      example:
        pageNumber: 0
        pageSize: 20
        totalPages: 10
        totalSize: 200
        elements: []
  parameters:
    pageParam:
      in: query
      name: page
      schema:
        type: integer
      description: Page number
    sizeParam:
      in: query
      name: size
      schema:
        type: integer
      description: Number of results to return (result per page)
    sortParam:
      in: query
      name: sort
      schema:
        type: string
      description: Field name to sort by
    dirParam:
      in: query
      name: dir
      schema:
        type: string
      description: Sort direction (ASC or DESC)
  requestBodies:
    SearchCriteria:
      description: >
        Criteria used for searching records, including a structured query (q) and text search (s)
      content:
        application/json:
          schema:
            type: object
            properties:
              s:
                type: string
                description: Optional value to search against any fields in a text index for those records.
              q:
                type: object
                description: Structured search object for matching database records. Typically supports MongoDB queries.
            example:
              s: 'search string'
              q: { }
  responses:
    NotAuthenticated:
      description: User not authenticated
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 400
            type: 'missing-credentials'
            message: 'Missing credentials'