Skip to content

Input Object example not working #1064

@carlossouza-v12

Description

@carlossouza-v12

I am using the metadataFile directive following the example from the official documentation:
https://github.com/anvilco/spectaql/blob/main/examples/data/metadata.json

However, it is not working as expected. When I generate the documentation by running the spectaql command, the examples defined for INPUT_OBJECT fields are empty, while the examples for all other types (OBJECT, SCALAR, QUERY, etc.) continue to work correctly.

package.JSON:

"devDependencies": {
    "spectaql": "3.0.5"
  },

config.yml:

spectaql:
  logoFile: ./imgs/logo.png
  faviconFile: ./imgs/logo.png
  displayAllServers: true

introspection:
  url: myapi.url.com
  metadataFile: ./examples/metadata.json
  fieldExpansionDepth: 5
  spectaqlDirective:
    enable: true

servers:
  - url: myapi.url.com
    description: OpenAPI V12 production environment
    headers:
      - name: X-Public-Key
        example: XXXXXXXXXXXXXXXXXXXXXXXX
      - name: X-Secret-Key
        example: XXXXXXXXXXXXXXXXXXXXXXXX
  - url: myapi.url.com
    description: OpenAPI V12 development environment

info:
  title: OpenAPI V12 GraphQL API
  description: V12 OpenAPI GraphQL API Documentation
  version: 1.0.0
  x-introItems:

output:
  dir: docs
  format: html

./examples/metadata.json:

{
...
"INPUT_OBJECT": {
    "HotelDetailsInput": {
      "inputFields": {
        "id": {
          "documentation": {
            "example": "234665"
          }
        },
        "searchToken": {
          "documentation": {
            "example": "a81bc81b-dead-4e5d-abff-90865d1e13b1"
          }
        }
      }
    }
  },

Result:

Image

Someone can help me?🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions