chore(oas): PascalCase for schemas + remove x-resourceId (#2847)
### What Rename all JSDoc OAS `@schema` and `$ref: #/components/schemas/` from snake_case to PascalCase, `foo_bar -> FooBar` Extra scope: Remove `x-resourceId` from JSDoc OAS. ### Why Classes use PascalCase as a convention but the OAS @schemas describing them were using snake_case. OAS code generators tend to use the schema name when generating typed models. In order to avoid mismatch between source code, the OAS, and the generated client code, it is advised to align OAS @schemas formatting to the classes they represent. Extra scope: x-resourceId is not a widely used OAS property. It's current usage in our OAS does not provide additional value. Therefore, we recommend to remove it in order to have one less item to maintain. ### How Good old search & replace. Regex search to further make sure we didn't miss any. The scope is limited to `@schema` definition and their usage in `$ref: #/components/schemas/`. ### Test * Ran OAS validator. * Ran docs build script. Expect no visible changes to the documentation. Resolves: CORE-852, CORE-859
This commit is contained in:
@@ -55,111 +55,82 @@ info:
|
||||
name: MIT
|
||||
url: https://github.com/medusajs/medusa/blob/master/LICENSE
|
||||
tags:
|
||||
- name: Auth
|
||||
description: Auth endpoints that allow authorization of admin Users and manages
|
||||
their sessions.
|
||||
- name: App
|
||||
description: App endpoints that allow handling apps in Medusa.
|
||||
x-resourceId: OAuth
|
||||
- name: Batch Job
|
||||
description: Batch Job endpoints that allow handling batch jobs in Medusa.
|
||||
x-resourceId: batch_job
|
||||
- name: Claim
|
||||
description: Claim endpoints that allow handling claims in Medusa.
|
||||
x-resourceId: claim_order
|
||||
- name: Collection
|
||||
description: Collection endpoints that allow handling collections in Medusa.
|
||||
x-resourceId: product_collection
|
||||
- name: Customer
|
||||
description: Customer endpoints that allow handling customers in Medusa.
|
||||
x-resourceId: customer
|
||||
- name: Customer Group
|
||||
description: Customer Group endpoints that allow handling customer groups in Medusa.
|
||||
x-resourceId: customer_group
|
||||
- name: Discount
|
||||
description: Discount endpoints that allow handling discounts in Medusa.
|
||||
x-resourceId: discount
|
||||
- name: Discount Condition
|
||||
description: Discount Condition endpoints that allow handling discount conditions
|
||||
in Medusa.
|
||||
x-resourceId: discount_condition
|
||||
- name: Draft Order
|
||||
description: Draft Order endpoints that allow handling draft orders in Medusa.
|
||||
x-resourceId: draft-order
|
||||
- name: Gift Card
|
||||
description: Gift Card endpoints that allow handling gift cards in Medusa.
|
||||
x-resourceId: gift_card
|
||||
- name: Invite
|
||||
description: Invite endpoints that allow handling invites in Medusa.
|
||||
x-resourceId: invite
|
||||
- name: Note
|
||||
description: Note endpoints that allow handling notes in Medusa.
|
||||
x-resourceId: note
|
||||
- name: Notification
|
||||
description: Notification endpoints that allow handling notifications in Medusa.
|
||||
x-resourceId: notification
|
||||
- name: Order
|
||||
description: Order endpoints that allow handling orders in Medusa.
|
||||
x-resourceId: order
|
||||
- name: Price List
|
||||
description: Price List endpoints that allow handling price lists in Medusa.
|
||||
x-resourceId: price_list
|
||||
- name: Product
|
||||
description: Product endpoints that allow handling products in Medusa.
|
||||
x-resourceId: product
|
||||
- name: Product Tag
|
||||
description: Product Tag endpoints that allow handling product tags in Medusa.
|
||||
x-resourceId: product_tag
|
||||
- name: Product Type
|
||||
description: Product Types endpoints that allow handling product types in Medusa.
|
||||
x-resourceId: product_type
|
||||
- name: Product Variant
|
||||
description: Product Variant endpoints that allow handling product variants in Medusa.
|
||||
x-resourceId: product_variant
|
||||
- name: Region
|
||||
description: Region endpoints that allow handling regions in Medusa.
|
||||
x-resourceId: region
|
||||
- name: Return Reason
|
||||
description: Return Reason endpoints that allow handling return reasons in Medusa.
|
||||
x-resourceId: return_reason
|
||||
- name: Return
|
||||
description: Return endpoints that allow handling returns in Medusa.
|
||||
x-resourceId: return
|
||||
- name: Sales Channel
|
||||
description: Sales Channel endpoints that allow handling sales channels in Medusa.
|
||||
x-resourceId: sales_channel
|
||||
- name: Shipping Option
|
||||
description: Shipping Option endpoints that allow handling shipping options in Medusa.
|
||||
x-resourceId: shipping_option
|
||||
- name: Shipping Profile
|
||||
description: Shipping Profile endpoints that allow handling shipping profiles in
|
||||
Medusa.
|
||||
x-resourceId: shipping_profile
|
||||
- name: Store
|
||||
description: Store endpoints that allow handling stores in Medusa.
|
||||
x-resourceId: store
|
||||
- name: Swap
|
||||
description: Swap endpoints that allow handling swaps in Medusa.
|
||||
x-resourceId: swap
|
||||
- name: Tax Rate
|
||||
description: Tax Rate endpoints that allow handling tax rates in Medusa.
|
||||
x-resourceId: tax_rate
|
||||
- name: Upload
|
||||
description: Upload endpoints that allow handling uploads in Medusa.
|
||||
- name: User
|
||||
description: User endpoints that allow handling users in Medusa.
|
||||
x-resourceId: user
|
||||
- name: Auth
|
||||
description: Auth endpoints that allow authorization of admin Users and manages
|
||||
their sessions.
|
||||
- name: App
|
||||
description: App endpoints that allow handling apps in Medusa.
|
||||
- name: Batch Job
|
||||
description: Batch Job endpoints that allow handling batch jobs in Medusa.
|
||||
- name: Claim
|
||||
description: Claim endpoints that allow handling claims in Medusa.
|
||||
- name: Collection
|
||||
description: Collection endpoints that allow handling collections in Medusa.
|
||||
- name: Customer
|
||||
description: Customer endpoints that allow handling customers in Medusa.
|
||||
- name: Customer Group
|
||||
description: Customer Group endpoints that allow handling customer groups in Medusa.
|
||||
- name: Discount
|
||||
description: Discount endpoints that allow handling discounts in Medusa.
|
||||
- name: Discount Condition
|
||||
description: Discount Condition endpoints that allow handling discount conditions
|
||||
in Medusa.
|
||||
- name: Draft Order
|
||||
description: Draft Order endpoints that allow handling draft orders in Medusa.
|
||||
- name: Gift Card
|
||||
description: Gift Card endpoints that allow handling gift cards in Medusa.
|
||||
- name: Invite
|
||||
description: Invite endpoints that allow handling invites in Medusa.
|
||||
- name: Note
|
||||
description: Note endpoints that allow handling notes in Medusa.
|
||||
- name: Notification
|
||||
description: Notification endpoints that allow handling notifications in Medusa.
|
||||
- name: Order
|
||||
description: Order endpoints that allow handling orders in Medusa.
|
||||
- name: Price List
|
||||
description: Price List endpoints that allow handling price lists in Medusa.
|
||||
- name: Product
|
||||
description: Product endpoints that allow handling products in Medusa.
|
||||
- name: Product Tag
|
||||
description: Product Tag endpoints that allow handling product tags in Medusa.
|
||||
- name: Product Type
|
||||
description: Product Types endpoints that allow handling product types in Medusa.
|
||||
- name: Product Variant
|
||||
description: Product Variant endpoints that allow handling product variants in Medusa.
|
||||
- name: Region
|
||||
description: Region endpoints that allow handling regions in Medusa.
|
||||
- name: Return Reason
|
||||
description: Return Reason endpoints that allow handling return reasons in Medusa.
|
||||
- name: Return
|
||||
description: Return endpoints that allow handling returns in Medusa.
|
||||
- name: Sales Channel
|
||||
description: Sales Channel endpoints that allow handling sales channels in Medusa.
|
||||
- name: Shipping Option
|
||||
description: Shipping Option endpoints that allow handling shipping options in Medusa.
|
||||
- name: Shipping Profile
|
||||
description: Shipping Profile endpoints that allow handling shipping profiles in
|
||||
Medusa.
|
||||
- name: Store
|
||||
description: Store endpoints that allow handling stores in Medusa.
|
||||
- name: Swap
|
||||
description: Swap endpoints that allow handling swaps in Medusa.
|
||||
- name: Tax Rate
|
||||
description: Tax Rate endpoints that allow handling tax rates in Medusa.
|
||||
- name: Upload
|
||||
description: Upload endpoints that allow handling uploads in Medusa.
|
||||
- name: User
|
||||
description: User endpoints that allow handling users in Medusa.
|
||||
servers:
|
||||
- url: https://api.medusa-commerce.com/admin
|
||||
paths: {}
|
||||
- url: https://api.medusa-commerce.com/admin
|
||||
paths: { }
|
||||
components:
|
||||
responses:
|
||||
responses:
|
||||
default_error:
|
||||
description: Default Error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/error"
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
example:
|
||||
code: "unknown_error"
|
||||
message: "An unknown error occurred."
|
||||
@@ -168,8 +139,8 @@ components:
|
||||
description: Invalid State Error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/error"
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
example:
|
||||
code: "unknown_error"
|
||||
message: "The request conflicted with another request. You may retry the request with the provided Idempotency-Key."
|
||||
@@ -178,8 +149,8 @@ components:
|
||||
description: Invalid Request Error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/error"
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
example:
|
||||
code: "invalid_request_error"
|
||||
message: "Discount with code TEST already exists."
|
||||
@@ -188,8 +159,8 @@ components:
|
||||
description: Not Found Error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/error"
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
example:
|
||||
message: "Entity with id 1 was not found"
|
||||
type: "not_found"
|
||||
@@ -198,23 +169,23 @@ components:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/error"
|
||||
- $ref: "#/components/schemas/multiple_errors"
|
||||
examples:
|
||||
oneOf:
|
||||
- $ref: "#/components/schemas/Error"
|
||||
- $ref: "#/components/schemas/MultipleErrors"
|
||||
examples:
|
||||
not_allowed:
|
||||
$ref: "#/components/examples/not_allowed_error"
|
||||
invalid_data:
|
||||
$ref: "#/components/examples/invalid_data_error"
|
||||
multiple_errors:
|
||||
MultipleErrors:
|
||||
$ref: "#/components/examples/multiple_errors"
|
||||
500_error:
|
||||
description: Server Error
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/error"
|
||||
examples:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Error"
|
||||
examples:
|
||||
database:
|
||||
$ref: "#/components/examples/database_error"
|
||||
unexpected_state:
|
||||
@@ -225,17 +196,17 @@ components:
|
||||
$ref: "#/components/examples/default_error"
|
||||
unauthorized:
|
||||
description: 'User is not authorized. Must log in first'
|
||||
content:
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
schema:
|
||||
type: string
|
||||
default: Unauthorized
|
||||
example: Unauthorized
|
||||
incorrect_credentials:
|
||||
description: 'User does not exist or incorrect credentials'
|
||||
content:
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
schema:
|
||||
type: string
|
||||
default: Unauthorized
|
||||
example: Unauthorized
|
||||
|
||||
Reference in New Issue
Block a user