apigee-127 / swagger-tools

A Node.js and browser module that provides tooling around Swagger.
MIT License
701 stars 373 forks source link

400 Bad Request on request validation error #578

Open AhsanNissar opened 6 years ago

AhsanNissar commented 6 years ago

capture2

Just faced this issue and i have no idea why. My DTO structure is here export interface ICreateTeacherDto { firstname: string | undefined; lastname: string | undefined; teacherKey: string | undefined; emailAddress: string | undefined; fatherName: string | undefined; tenantName: string | undefined; addressLine: string | undefined; middleName: string | undefined; countyId: number | undefined; cityId: number | undefined; districtId: number | undefined; gender: string | undefined; contactNumber: string | undefined; datOfBirth: string | undefined; classTeacher: string | undefined; teacherSubjects: string[] | undefined; }

whitlockjc commented 6 years ago

I have no idea how swagger-tools is involved here. I don't see any mention of swagger-tools and the screenshot isn't helping. Can you provide more details?

AhsanNissar commented 6 years ago

I have all my defined API's in swaggerUI and i am working with angular boilerplate to add data in the DB but i am passing data by making use of DTO's that i have created for my teacher module. All the DTO's are initialized with the data but at the backend in .net core my API is not fetching the data properly to POST it into DB. The problem is occuring in the last Object of "teacherSubjects". But i am unable to understand why.