chore(oas): explicitly declare type:object on schemas with properties (#2712)
### What OAS: Explicitly declare type:object on schemas with properties. ### Why While not officially required, schemas with properties should have their type explicitly declared as "object". Omitting the type translates to type: any with properties XYZ. The ambiguity can lead to issues when using code generators. ### How Multiple regex searches to identify schemas missing type: object. Manually edit each schema. Spot check generated OAS. ### Testing - Ran OAS validator. - Ran docs build script ### Proof  RESOLVES CORE-847
This commit is contained in:
@@ -33,6 +33,7 @@ import { IsType } from "../../../../utils/validators/is-type"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* required:
|
||||
* - email
|
||||
* - items
|
||||
@@ -175,6 +176,7 @@ import { IsType } from "../../../../utils/validators/is-type"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* draft_order:
|
||||
* $ref: "#/components/schemas/draft-order"
|
||||
|
||||
@@ -26,6 +26,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* required:
|
||||
* - quantity
|
||||
* properties:
|
||||
@@ -78,6 +79,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* draft_order:
|
||||
* $ref: "#/components/schemas/draft-order"
|
||||
|
||||
@@ -35,6 +35,7 @@ import { EntityManager } from "typeorm"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* id:
|
||||
* type: string
|
||||
|
||||
@@ -45,6 +45,7 @@ import { MedusaError } from "medusa-core-utils"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* draft_order:
|
||||
* $ref: "#/components/schemas/draft-order"
|
||||
|
||||
@@ -42,6 +42,7 @@ import { DraftOrder } from "../../../.."
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* draft_order:
|
||||
* $ref: "#/components/schemas/draft-order"
|
||||
|
||||
@@ -48,6 +48,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* draft_orders:
|
||||
* type: array
|
||||
|
||||
@@ -46,6 +46,7 @@ import { EntityManager } from "typeorm"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* order:
|
||||
* $ref: "#/components/schemas/draft-order"
|
||||
|
||||
@@ -31,6 +31,7 @@ import { IsType } from "../../../../utils/validators/is-type"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* region_id:
|
||||
* type: string
|
||||
@@ -105,6 +106,7 @@ import { IsType } from "../../../../utils/validators/is-type"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* draft_order:
|
||||
* $ref: "#/components/schemas/draft-order"
|
||||
|
||||
@@ -25,6 +25,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* unit_price:
|
||||
* description: The potential custom price of the item.
|
||||
@@ -71,6 +72,7 @@ import { validator } from "../../../../utils/validator"
|
||||
* content:
|
||||
* application/json:
|
||||
* schema:
|
||||
* type: object
|
||||
* properties:
|
||||
* draft_order:
|
||||
* $ref: "#/components/schemas/draft-order"
|
||||
|
||||
Reference in New Issue
Block a user