diff --git a/packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml b/packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml index 65905e95ef74e..e34435195ad1b 100644 --- a/packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml +++ b/packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml @@ -31,6 +31,16 @@ decorators: - AdminProduct AdminProduct: - AdminProduct + AdminStockLocation: + - AdminFulfillmentSet + OrderChange: + - Order + StoreShippingOption: + - StoreShippingOption + AdminServiceZone: + - AdminFulfillmentSet + OrderTransaction: + - Order # Similar config to /www/docs/docusaurus.config.js > redocusaurus # Allows to emulate rendering of API public documentation when using `yarn redocly preview-docs openapi.yaml` diff --git a/www/utils/generated/oas-output/base/admin.oas.base.yaml b/www/utils/generated/oas-output/base/admin.oas.base.yaml index 0157d01589f37..461f1ffae8f59 100644 --- a/www/utils/generated/oas-output/base/admin.oas.base.yaml +++ b/www/utils/generated/oas-output/base/admin.oas.base.yaml @@ -106,6 +106,23 @@ servers: - url: https://api.medusa-commerce.com paths: {} components: + schemas: + Error: + title: "Response Error" + type: object + properties: + code: + type: string + description: A slug code to indicate the type of the error. + enum: [invalid_state_error, invalid_request_error, api_error, unknown_error] + message: + type: string + description: Description of the error that occurred. + example: "first_name must be a string" + type: + type: string + description: A slug indicating the type of the error. + enum: [QueryRunnerAlreadyReleasedError, TransactionAlreadyStartedError, TransactionNotStartedError, conflict, unauthorized, payment_authorization_error, duplicate_error, not_allowed, invalid_data, not_found, database_error, unexpected_state, invalid_argument, unknown_error] responses: default_error: description: Default Error @@ -246,4 +263,4 @@ components: type: apiKey in: cookie name: connect.sid - x-displayName: Cookie Session ID + x-displayName: Cookie Session ID \ No newline at end of file diff --git a/www/utils/generated/oas-output/base/store.oas.base.yaml b/www/utils/generated/oas-output/base/store.oas.base.yaml index 8db9069e9df6a..7239203b4ea06 100644 --- a/www/utils/generated/oas-output/base/store.oas.base.yaml +++ b/www/utils/generated/oas-output/base/store.oas.base.yaml @@ -47,6 +47,23 @@ servers: - url: https://api.medusa-commerce.com paths: {} components: + schemas: + Error: + title: "Response Error" + type: object + properties: + code: + type: string + description: A slug code to indicate the type of the error. + enum: [invalid_state_error, invalid_request_error, api_error, unknown_error] + message: + type: string + description: Description of the error that occurred. + example: "first_name must be a string" + type: + type: string + description: A slug indicating the type of the error. + enum: [QueryRunnerAlreadyReleasedError, TransactionAlreadyStartedError, TransactionNotStartedError, conflict, unauthorized, payment_authorization_error, duplicate_error, not_allowed, invalid_data, not_found, database_error, unexpected_state, invalid_argument, unknown_error] responses: default_error: description: Default Error diff --git a/www/utils/packages/docs-generator/src/classes/helpers/schema-factory.ts b/www/utils/packages/docs-generator/src/classes/helpers/schema-factory.ts index 10b5cc3587917..c15155e4ac4ee 100644 --- a/www/utils/packages/docs-generator/src/classes/helpers/schema-factory.ts +++ b/www/utils/packages/docs-generator/src/classes/helpers/schema-factory.ts @@ -27,6 +27,22 @@ class SchemaFactory { type: "string", format: "date-time", }, + $and: { + type: "array", + description: + "Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.", + items: { + type: "object", + }, + }, + $or: { + type: "array", + description: + "Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.", + items: { + type: "object", + }, + }, } /** diff --git a/www/utils/packages/docs-generator/src/classes/kinds/oas.ts b/www/utils/packages/docs-generator/src/classes/kinds/oas.ts index 060e92d7141c3..f81dfe9023baa 100644 --- a/www/utils/packages/docs-generator/src/classes/kinds/oas.ts +++ b/www/utils/packages/docs-generator/src/classes/kinds/oas.ts @@ -1653,9 +1653,21 @@ class OasKindGenerator extends FunctionKindGenerator { (updatedParameter.schema as OpenApiSchema).type !== (parameter.schema as OpenApiSchema).type ) { - ;(parameter.schema as OpenApiSchema).type = ( - updatedParameter.schema as OpenApiSchema - ).type + // the entire schema should be updated if the type changes. + parameter.schema = updatedParameter.schema + } else if ((updatedParameter.schema as OpenApiSchema).type === "array") { + ;(parameter.schema as OpenAPIV3.ArraySchemaObject).items = + this.updateSchema({ + oldSchema: (parameter.schema as OpenAPIV3.ArraySchemaObject).items, + newSchema: (updatedParameter.schema as OpenAPIV3.ArraySchemaObject) + .items, + }) || (updatedParameter.schema as OpenAPIV3.ArraySchemaObject).items + } else if ((updatedParameter.schema as OpenApiSchema).type === "object") { + parameter.schema = + this.updateSchema({ + oldSchema: parameter.schema, + newSchema: updatedParameter.schema, + }) || updatedParameter.schema } if (