env0 / env0/serverless-openapi-typescript
unrecognized property 'documentation'
- Lenguaje dominante
- TypeScript
- Estrellas
- 14
- Forks
- 7
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Hello,
i have my serverless.ts with this function:
```
functions: {
getPatients
}
```
and the documentation section of the serverless.ts with this configuration:
```
documentation: {
version: '1',
title: 'Claire API',
description: 'Claire API',
securitySchemes: {},
security: {},
models: {}
}
```
My getPatients function is imported and has this content:
```
import schema from './schema';
import { handlerPath } from '@libs/handler-resolver';
export default {
handler: `${handlerPath(__dirname)}/handler.main`,
events: [
{
http: {
method: 'GET',
path: 'patients',
request: {
schemas: {
'application/json': schema,
},
},
}
}
],
};
```
The problem is i got this error: "Some functions have http events which are not documented: getPatients".
If i add this json to the http event:
```
documentation: {
summary: "get patients",
methodResponses: [
{
statusCode: 200,
responseBody: "OK"
}
]
},
```
then i got this error: No root type "undefined.GetPatients.Response" found.
And this warning: Invalid configuration encountered
at 'functions.getPatients.events.0.http': unrecognized property 'documentation'
Cacn anyone help me? Thank you
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Reproduce el problema de serverless.ts usando la función importada getPatients, su evento HTTP y el esquema de ./schema. Sigue cómo el plugin valida la configuración del evento HTTP y deriva el modelo de respuesta, centrándote en la propiedad de documentación no reconocida y en el error undefined.GetPatients.Response. Se considera completado cuando se acepta la configuración y el endpoint getPatients queda documentado sin errores de validación ni de tipo raíz.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- api, backend-api-design
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100