Files
medusa-store/packages
Patrick b700c6ba5b chore(oas): replace requestBody with $ref to req class JSDoc OAS (#2867)
### What

Move inline OAS requestBody schema declaration under their respective class-validator classes in order to expose them through  `#/components/schemas`. Replace inline OAS requestBody schema with a `$ref` reference pointing to the newly declared schema.

### Why

Having requestBody declared as its own "named" schema will allow OAS code generators to output typed entities/DTO that can be manipulate without having to reference the route/operation.

### How

Declare a new @schema JSDoc for each class-validator used to parse and validate request body. Move the current inline requestBody to the new @schema.

### Test

- Ran OAS validator.
- Ran docs build script.

Expect no visible changes to the documentation.

### Out-of-scope

requestBody of type `multipart/form-data` used for file uploads. These will be address as part of CORE-934
- [create-upload.ts](58d23a7b45/packages/medusa/src/api/routes/admin/uploads/create-upload.ts (L87-L90))
- [create-protected-upload.ts](58d23a7b45/packages/medusa/src/api/routes/admin/uploads/create-protected-upload.ts (L87-L90))

Path Parameter and Query Parameter. These will need more research and experimentation, part of CORE-931

---

Resolves CORE-853
2022-12-21 14:08:16 +00:00
..
2022-11-24 11:42:04 +01:00
2022-11-02 16:44:54 +01:00
2022-11-24 11:42:04 +01:00