info:
  description: |
    Mushroom edibility classifier for research.

    **Authentication Options**:
    - Recommended: Bearer token via `Authorization` header.
    - Fallback (GET): `token` query parameter.
    - Fallback (POST): `apiKey` in JSON body.
  title: Myconom API
  version: 1.0.0
openapi: 3.0.0
paths:
  /api/v1/myconom:
    post:
      requestBody:
        content:
          application/json:
            schema:
              properties:
                apiKey:
                  type: string
                bruises:
                  type: string
                capColor:
                  type: string
                capShape:
                  type: string
                capSurface:
                  type: string
                gillAttachment:
                  type: string
                gillColor:
                  type: string
                gillSize:
                  type: string
                gillSpacing:
                  type: string
                habitat:
                  type: string
                odor:
                  type: string
                population:
                  type: string
                ringNumber:
                  type: string
                ringType:
                  type: string
                sporePrintColor:
                  type: string
                stalkColorAboveRing:
                  type: string
                stalkColorBelowRing:
                  type: string
                stalkRoot:
                  type: string
                stalkShape:
                  type: string
                stalkSurfaceAboveRing:
                  type: string
                stalkSurfaceBelowRing:
                  type: string
                veilColor:
                  type: string
                veilType:
                  type: string
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  prediction:
                    type: string
                type: object
          description: Successful response
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '429':
          description: Too many requests
      summary: Classify a mushroom.
    get:
      parameters:
        - in: query
          name: capShape
          schema:
            type: string
          required: true
          description: Shape of the mushroom cap.
        - in: query
          name: capSurface
          schema:
            type: string
          required: true
          description: Surface texture of the mushroom cap.
        - in: query
          name: capColor
          schema:
            type: string
          required: true
          description: Color of the mushroom cap.
        - in: query
          name: bruises
          schema:
            type: string
          required: true
          description: Indicates if the mushroom bruises.
        - in: query
          name: odor
          schema:
            type: string
          required: true
          description: Odor of the mushroom.
        - in: query
          name: gillAttachment
          schema:
            type: string
          required: true
          description: How gills are attached to the stem.
        - in: query
          name: gillSpacing
          schema:
            type: string
          required: true
          description: Spacing of the gills.
        - in: query
          name: gillSize
          schema:
            type: string
          required: true
          description: Size of the gills.
        - in: query
          name: gillColor
          schema:
            type: string
          required: true
          description: Color of the gills.
        - in: query
          name: stalkShape
          schema:
            type: string
          required: true
          description: Shape of the stalk.
        - in: query
          name: stalkRoot
          schema:
            type: string
          required: true
          description: Type of stalk root.
        - in: query
          name: stalkSurfaceAboveRing
          schema:
            type: string
          required: true
          description: Surface texture of the stalk above the ring.
        - in: query
          name: stalkSurfaceBelowRing
          schema:
            type: string
          required: true
          description: Surface texture of the stalk below the ring.
        - in: query
          name: stalkColorAboveRing
          schema:
            type: string
          required: true
          description: Color of the stalk above the ring.
        - in: query
          name: stalkColorBelowRing
          schema:
            type: string
          required: true
          description: Color of the stalk below the ring.
        - in: query
          name: veilType
          schema:
            type: string
          required: true
          description: Type of veil.
        - in: query
          name: veilColor
          schema:
            type: string
          required: true
          description: Color of the veil.
        - in: query
          name: ringNumber
          schema:
            type: string
          required: true
          description: Number of rings.
        - in: query
          name: ringType
          schema:
            type: string
          required: true
          description: Type of ring.
        - in: query
          name: sporePrintColor
          schema:
            type: string
          required: true
          description: Color of the spore print.
        - in: query
          name: population
          schema:
            type: string
          required: true
          description: Population density.
        - in: query
          name: habitat
          schema:
            type: string
          required: true
          description: Habitat of the mushroom.
        - in: query
          name: token
          schema:
            type: string
          required: false
          description: Fallback authentication token.
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  prediction:
                    type: string
                type: object
          description: Successful response
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '429':
          description: Too many requests
      summary: Classify a mushroom.

components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

security:
  - bearerAuth: []  # Global security, but overridden per-path
servers:
- url: https://infinitode.netlify.app
