docs: oas (#197)

Adds OpenAPI specification of Storefront and Admin APIs.
Updates docs project.
This commit is contained in:
Sebastian Rindom authored and GitHub committed 2021-03-10 11:51:54 +01:00
1 parent 975de99ee7
commit 8edb32c742
240 files changed
+23592 -419

No files matched your search

+1
View File
@@ -0,0 +1 @@
{"openapi":"3.0.0","info":{"version":"1.0.0","title":"Medusa Admin API","license":{"name":"MIT"}},"tags":[{"name":"Auth","description":"Auth endpoints allows authorization of admin Users and manages their sessions."},{"name":"Collection","x-resourceId":"product_collection"},{"name":"Customer","x-resourceId":"customer"},{"name":"Discount","x-resourceId":"discount"},{"name":"Gift Card","x-resourceId":"gift_card"},{"name":"Notification","x-resourceId":"notification"},{"name":"Order","x-resourceId":"order"},{"name":"Product","x-resourceId":"product"},{"name":"Region","x-resourceId":"region"},{"name":"Return","x-resourceId":"return"},{"name":"Shipping Option","x-resourceId":"shipping_option"},{"name":"Shipping Profile","x-resourceId":"shipping_profile"},{"name":"Swap","x-resourceId":"swap"},{"name":"Product Variant","x-resourceId":"product_variant"}],"servers":[{"url":"https://api.medusa-commerce.com/admin"}],"paths":{"/auth":{"post":{"operationId":"PostAuth","summary":"Authenticate a User","description":"Logs a User in and authorizes them to manage Store settings.","parameters":[],"tags":["Auth"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"properties":{"customer":{"title":"User","description":"Represents a User who can manage store settings.","x-resourceId":"user","properties":{"id":{"description":"The unique id of the User. This will be prefixed with `usr_`","type":"string"},"email":{"description":"The email of the User","type":"string"},"first_name":{"type":"string"},"last_name":{"description":"The Customer's billing address.","anyOf":[{"title":"Address","description":"An address.","x-resourceId":"address","properties":{"id":{"type":"string"},"customer_id":{"type":"string"},"company":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"address_1":{"type":"string"},"address_2":{"type":"string"},"city":{"type":"string"},"country_code":{"type":"string"},"country":{"title":"Country","description":"Country details","x-resourceId":"country","properties":{"id":{"description":"The database id of the country","type":"integer"},"iso_2":{"description":"The 2 character ISO code for the country.","type":"string"},"iso_3":{"description":"The 3 character ISO code for the country.","type":"string"},"num_code":{"description":"The numerical ISO code for the country.","type":"string"},"name":{"description":"The normalized country name; in upper case.","type":"string"},"display_name":{"description":"The country name appropriate for display.","type":"string"}}}}}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"deleted_at":{"type":"string","format":"date-time"},"metadata":{"type":"object"}}}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","description":"The User's email."},"password":{"type":"string","description":"The User's password."}}}}}}},"get":{"operationId":"GetAuth","summary":"Get Session","description":"Gets the currently logged in User.","tags":["Auth"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"properties":{"customer":{"title":"User","description":"Represents a User who can manage store settings.","x-resourceId":"user","properties":{"id":{"description":"The unique id of the User. This will be prefixed with `usr_`","type":"string"},"email":{"description":"The email of the User","type":"string"},"first_name":{"type":"string"},"last_name":{"description":"The Customer's billing address.","anyOf":[{"title":"Address","description":"An address.","x-resourceId":"address","properties":{"id":{"type":"string"},"customer_id":{"type":"string"},"company":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"address_1":{"type":"string"},"address_2":{"type":"string"},"city":{"type":"string"},"country_code":{"type":"string"},"country":{"title":"Country","description":"Country details","x-resourceId":"country","properties":{"id":{"description":"The database id of the country","type":"integer"},"iso_2":{"description":"The 2 character ISO code for the country.","type":"string"},"iso_3":{"description":"The 3 character ISO code for the country.","type":"string"},"num_code":{"description":"The numerical ISO code for the country.","type":"string"},"name":{"description":"The normalized country name; in upper case.","type":"string"},"display_name":{"description":"The country name appropriate for display.","type":"string"}}}}}]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"deleted_at":{"type":"string","format":"date-time"},"metadata":{"type":"object"}}}}}}}}}}},"/customers":{"post":{"operationId":"PostCustomers","summary":"Create a Customer","description":"Creates a Customer.","parameters":[],"tags":["Customer"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"properties":Line truncated