Nestjs swagger array of objects github. 2 - Platform: Mac The text was updated successfully, but these errors were encountered: 馃憤 2 mathieugeissler and aciccarello reacted with thumbs up emoji Jun 16, 2018 路 How can I just simply set swagger to return an array of string? I'm was trying with: @ApiResponse({ status: 200, type: 'string', isArray: true }) But it doesn't work. It seems they are both trying to deal with the same issue. js framework for building efficient and scalable server-side applications. May 9, 2024 路 Is there an existing issue for this? I have searched the existing issues Current behavior I want to create a GET endpoint with a inner object inside query params: export class QueryParamsSubObject { @ApiProperty() subObjectStringParam: s Dec 27, 2020 路 I want to be able to declare arrays of complex objects in the first level of DTOs Environment Nest version: 7. nestjs / swagger Public Notifications You must be signed in to change notification settings Fork 505 Star 1. Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Jul 27, 2022 路 Is there an existing issue for this? I have searched the existing issues Current behavior export class ContainerCategoryDTO { @ApiProperty({ type: String }) @IsString() name: string; @ApiProperty({ type: String }) @IsString() value: stri Saved searches Use saved searches to filter your results more quickly Dec 14, 2020 路 nestjs / swagger Public. I tried the following: plugin in nest cli and added all the necessary decorators to filters and not use the @ApiProperty: doesn't work. I'm submitting a [x] Regression [ ] Bug report [ ] Feature request [ ] Documentation issue or request [ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow. The error: allOf must be a non-empty array of schemas. ts, but besides exporting a class I don't know how to export an array. Can be an array of object (or just May 29, 2020 路 I'd like CatInput to be properly rendered in Swagger It contains an array of objects called infos: export class Info { public name : string ; public color : string ; } export class CatInput { public infos : Info [ ] } PR Type What kind of change does this PR introduce? [x] Bugfix [ ] Feature [ ] Code style update (formatting, local variables) [ ] Refactoring (no functional changes, no api changes) [ ] Build related changes [ ] CI related changes [ ] Other Mar 2, 2021 路 This has been discussed several times in the past. Define a class with a nested object or array of objects as the response type; Sign up for free to join this conversation on GitHub This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. 1 For Tooling issues: - Node version: node:alpine docker image - Platform: node:alpine docker image May 6, 2020 路 The "An object inside an array of object" structure isn't presenting properly (both Example Values and Schema sections). ts export class NewBookingDto { @ ApiProperty ( { description : "List of buyers" , type : [ BuyerDto ] , } ) buyers : BuyerDto [ ] ; } May 3, 2023 路 I'd like CatInput to be properly rendered in Swagger It contains an array of objects called infos: export class Info { public name : string ; public color : string ; } export class CatInput { public infos : Info [ ] } Dec 20, 2018 路 the result is empty object, swagger module does not process the type recursively the swagger output should be nested array of the type //docs. 0, the errors disappear. Here is my code structure: // NewBookingDto. May 23, 2018 路 I'm trying to figure out how to make my ApiModelProperty decorators so that Swagger would work with objects as query parameters. Oct 8, 2022 路 Is there an existing issue for this? I have searched the existing issues Current behavior Nested object properties are using required: true instead of an array. 1 For Tooling issues: - Node version: v8. Due to the limited metadata information the TypeScript compiler provides us with, this is pretty much impossible to accomplish without implementing even more features in the existing CLI plugin that runs as part of the compilation. If @Body() parameter: MyDto[] is an array, Nest generates an empty definition called Array, which conflicts with the built-in Array type. 7 @nestjs/swagger@2. I am able to generate swagger that look like this: "OrganizationDto": { "typ May 11, 2022 路 Is there an existing issue for this? I have searched the existing issues Current behavior Hi, I get a "Module not found" run-time error, precisely the following one when I start the server after build: (node:2968) UnhandledPromiseRejecti Sep 13, 2018 路 Nest version: 5. I'd like to be able to set the openapi version through a DocumentBuilder set function Jun 15, 2021 路 I'm somewhat unclear on apparent duplication in schema-object-factory and swagger-types-mapper. I'm also trying to use class-transformer with discriminators but swagger prints out [{}] export class GetPageDto extends W Aug 25, 2020 路 I have a DTO and in this DTO I'd like one of my property (that is an object) to have his properties required using @ApiProperty. 3. but userRoles is not an array of UserRole But a weird object that looks like that : Mar 27, 2023 路 When generating OAS docs for my service, the swagger-ui editor returns errors for some of the nested objects. 8k How to write a Class with this? : movements: type: array items: Documentation for nestjs-swagger-dtonestjs-swagger-dto Nest. Thank you!. If I change the openapi version to 3. I know I probably need to declare and export something in the *. com Sep 23, 2019 路 Current behavior. 1. Is there an existing issue for this? I have searched the existing issues Current behavior I want to create a GET endpoint with a inner object inside query params: export class QueryParamsSubObject Aug 15, 2024 路 I am getting this. @ApiProperty({ type: [FilterDto]}) instead of @ApiProperty({ type: FilterDto, isArray: true }): doesn't work. To review, open the file in an editor that reveals hidden Unicode characters. js Swagger DTO decorators This library combines common @nestjs/swagger, class-transformer and class-validator decorators that are used together into one decorator for full Nest. Expected behavior In this case you see that it's possible to set the DTO myObject property to be required (red frame), it's possible to set the properties of firstProperty to be required (blue frame), but it's not Nov 5, 2024 路 nestjs / swagger Public. My case is something like this: class PersonQueryDto { @ApiModelProperty({ type: QueryFilterDto, isArray: tr Nov 23, 2022 路 GitHub Advanced Security @nestjs/swagger : 6. Aug 23, 2022 路 NestJs Swagger body array with mixed types Asked 2 years, 10 months ago Modified 1 year, 11 months ago Viewed 4k times Hint Consider using the Swagger plugin (see Plugin section) which will automatically detect arrays. Learn more about bidirectional Unicode characters Nov 3, 2018 路 I'm submitting a [ ] Regression [ ] Bug report [ x ] Feature request [ ] Documentation issue or request [ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow. Adding the ApiImplicitBody decorator does not fix the problem, the only solution is to set the parameter type to any and use ApiImplicitBody, but then the code does not have the correct type. A progressive Node. 11. nestjs. Either include the type as the first element of an array (as shown above) or set the isArray property to true. NestJS version. Is there an existing issue for this? I have searched the existing issues Current behavior Nested object properties are using required: true instead of an array. I am able to generate swagger that look like this: "OrganizationDto": { "typ May 13, 2019 路 Version : "@nestjs/swagger": "^2. js DTO lifecycle including OpenAPI schema descriptions. 1" I'm trying to print out an API response with a list of various object types. Describe the solution you'd like. dto. 5. bhro qjhc viqhku lmpt avmyzuz wzudpk yelat zbjss fzku igvhhn