About "In components section, schemas subsection is not an object"

openapi: 3.1.0
info:
  version: 1.0.0
  title: aaa
  summary: ""
servers:
  - url: https://******.cybozu.com
    description: ""
paths:
  /k/v1/records.json:
    get:
      parameters:
        - name: app
          in: query
          required: true
          description: The ID of the kintone application
          schema:
            type: integer
      summary: Your GET endpoint
      operationId: receivedata
      servers:
        - url: https://******.cybozu.com
          description: ""
      responses:
        "200":
          description: A normal response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
components:
  securitySchemes:
    apikey:
      type: apiKey
      in: header
      name: X-Cybozu-API-Token
security:
  - apikey: []

I get an error message “In components section, schemas subsection is not an object”.
Please tell me how to resolve.

We are also getting the same error.

Did your error resolve, @kyouma0608? If yes, how?

@kyouma0608 and @gumlet I was getting the same error message today. I resolved it by creating a dummy object in my components section, like this:

security:
  - BearerAuth: []
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
  schemas:
    Foo:
      type: object
      properties:
        bar:
          type: string
          description: bar desc.
2 Likes

This solved it for me, thank you!