Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when generating Typescript interface from a fresh dev-main APIP core #322

Open
revollat opened this issue Apr 4, 2022 · 0 comments

Comments

@revollat
Copy link

revollat commented Apr 4, 2022

API Platform version(s) affected: dev-main (v3)

Description
I try to generate typescript interfaces from client-generator tool it work sfind with the demo https://demo.api-platform.com/ but not with my personal instance but I can't make sense of the error message, any heap ?

node ➜ /srv/app/front $ npm run generate-types

> calico-front@0.0.1 generate-types
> NODE_TLS_REJECT_UNAUTHORIZED=0 npx @api-platform/client-generator --generator typescript https://api.calico.dev types/generated/ --resource Book
{
  api: Api { entrypoint: 'https://api.calico.dev', resources: [] },
  error: jsonld.InvalidUrl: Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.
      at ContextResolver._fetchContext (/home/node/.npm/_npx/5feb941c1afcc05f/node_modules/jsonld/lib/ContextResolver.js:186:13)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async ContextResolver._resolveRemoteContext (/home/node/.npm/_npx/5feb941c1afcc05f/node_modules/jsonld/lib/ContextResolver.js:117:34)
      at async ContextResolver.resolve (/home/node/.npm/_npx/5feb941c1afcc05f/node_modules/jsonld/lib/ContextResolver.js:50:22)
      at async api.process (/home/node/.npm/_npx/5feb941c1afcc05f/node_modules/jsonld/lib/context.js:65:20)
      at async api.expand (/home/node/.npm/_npx/5feb941c1afcc05f/node_modules/jsonld/lib/expand.js:211:17)
      at async Function.jsonld.expand (/home/node/.npm/_npx/5feb941c1afcc05f/node_modules/jsonld/lib/jsonld.js:331:18)
      at async Promise.all (index 1) {
    details: {
      code: 'invalid remote context',
      url: 'https://api.calico.dev/contexts/Entrypoint'
    }
  },
  response: undefined,
  status: undefined
}
node ➜ /srv/app/front $ curl https://api.calico.dev/contexts/Entrypoint
[{"@vocab":"https:\/\/api.calico.dev\/docs.jsonld#","hydra":"http:\/\/www.w3.org\/ns\/hydra\/core#","book":{"@id":"Entrypoint\/book","@type":"@id"}}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants