-
Notifications
You must be signed in to change notification settings - Fork 909
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
Add openApiGenerator and class-schema-validator #141
base: develop
Are you sure you want to change the base?
Conversation
Thnx. Tested some stuff with it. |
It seems to be a error of the library |
Well I just found out the it is caused by the configuration in the meta data of the schema references. Its missing a slash (/). Seems to work. Still testing some things though |
I found the error. Now should work fine. |
@somehowchris Have you tried the last changes? |
Yes and it works. But im struggling with adding token auth to the endpoints. |
Hi, was the problem including the "security": [
{
"basicAuth": []
}
] We can handle that with the import { OpenAPI } from 'routing-controllers-openapi'
@Post()
@OpenAPI({ security: [{ basicAuth: [] }] })
public create(@Body() pet: Pet): Promise<Pet> {
// ...
} If adding the same const OpenAPIBasicAuth = OpenAPI({ security: [{ basicAuth: [] }] })
@Post()
@OpenAPIBasicAuth
public create(@Body() pet: Pet): Promise<Pet> {
// ...
} Alternatively I was thinking we could extend @Authorized()
@JsonController('/users')
@OpenAPI({ security: [{ basicAuth: [] }] })
export class UserController {
// ... What do you think? @somehowchris |
Thanks for your help. I made some mistake in the global security definition. No my configuration of my swagger file looks like that
|
Just a heads-up, |
Nice 👌 |
Im running again into a problem.
If have it there then the MetaStorage seems to be empty. And therefor no entities are showing in the swagger. I've nailed it down to this line in the constructor
I've imported the things correctly and also tried it with @OrmRepository. Thanks for your help |
@gualtierim @epiphone Its happens to me in 8 of 8 projects |
Has todo with the useContainer function in iocLoader. Small workaround: Get the metadata before and set it into the settings, load it in the swaggerLoader and merge it with the container metadata. |
@gualtierim @epiphone Other thing. Sometimes I get those warnings:
Any ideas why? Or sometimes example references seem to be null in the json edit view of swagger
|
Hi,
I added
routing-controllers-openapi
in order to create dinamically the swaggerFile. The staticswagger.json
now is no more necessary.When running the command
npm run start
nps throught the following error, but this error is not due to changes made:Thanks!