feat(oas): add @schema OAS for address request payloads (#3423)

## What

Replace AddressFields with actual AddressPayload schema based off the actual type used by the controllers.

## Why

AddressPayload is currently being referenced in client code. Our OAS schema should attempt to match current client usage in order to reduce friction when migrating to a OAS generated types package.

## How

* Represent AddressPayload and AddressCreatePayload in our OAS schemas.
* Replace reference to AddressFields
* Plus, fix typo in /admin/orders/ route
This commit is contained in:
Patrick authored and GitHub committed 2023-03-09 14:31:40 +00:00
1 parent 784723a039
commit 4042beb102
14 files changed
+130 -83

No files matched your search

-55
View File
@@ -66,61 +66,6 @@ export class Address extends SoftDeletableEntity {
}
}
/**
* @schema AddressFields
* title: "Address Fields"
* description: "Address fields used when creating/updating an address."
* type: object
* properties:
* company:
* type: string
* description: Company name
* example: Acme
* first_name:
* type: string
* description: First name
* example: Arno
* last_name:
* type: string
* description: Last name
* example: Willms
* address_1:
* type: string
* description: Address line 1
* example: 14433 Kemmer Court
* address_2:
* type: string
* description: Address line 2
* example: Suite 369
* city:
* type: string
* description: City
* example: South Geoffreyview
* country_code:
* type: string
* description: The 2 character ISO code of the country in lower case
* externalDocs:
* url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements
* description: See a list of codes.
* example: st
* province:
* type: string
* description: Province
* example: Kentucky
* postal_code:
* type: string
* description: Postal Code
* example: 72093
* phone:
* type: string
* description: Phone Number
* example: 16128234334802
* metadata:
* type: object
* description: An optional key-value map with additional details
* example: {car: "white"}
*/
/**
* @schema Address
* title: "Address"