api-platform / api-platform/create-client

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

Abierto
#322 0 comentarios 2 reacciones 0 asignados Ver en GitHub
bug TypeScript
Lenguaje dominante
TypeScript
Estrellas
376
Forks
132
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**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 ?

```bash
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"}}]
```

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.