Skip to content
This repository was archived by the owner on Aug 18, 2023. It is now read-only.
This repository was archived by the owner on Aug 18, 2023. It is now read-only.

OpenApiTryIt component shows "Incorrect definitionId" error #195

@timothymcmackin

Description

@timothymcmackin

I forked this starter and tried to use the OpenApiTryIt MDX component as described in these docs:
https://redocly.com/docs/developer-portal/guides/step-by-step/

I added the catFacts API in the siteConfig.yaml file:

oasDefinitions:
  catFacts: https://catfact.ninja/docs/api-docs.json

Then I created this page in a file named developer-portal/openapi-try-it.mdx:

import { OpenApiTryIt, Alert, ExplainStep, scrollToHeading } from '@redocly/developer-portal/ui';

# Testing the openapi try it component

<OpenApiTryIt
  definitionId="catFacts"
  operationId="getRandomFact"
  id="step-1"
  onResponse={({ response }) => {
    console.log(response);
  }}
/>

When I run the portal locally and go to http://localhost:3000/developer-portal/openapi-try-it/ , I see an error that says Incorrect definitionId: "catFacts". What am I doing wrong? I've also tried downloading the openapi file and linking to it locally instead of putting the link in oasDefinitions.

Here's my minimal reproduction:
https://github.com/timothymcmackin/redocly-openapi-try-it

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