{ "openapi":"3.0.2", "info": { "title":"Address API", "version":"1.0.0" }, "servers": [ {"url":"https://localhost:8000"} ], "paths": { "/api/contacts/{idContact}/addresses": { "post": { "description": "create new address", "parameters": [ { "schema": { "type": "string" }, "name": "Authorization", "in": "header" }, { "required": true, "schema": { "type": "number" }, "name": "idContact", "in": "path" } ], "requestBody": { "description":"create new address", "content": { "application/json": { "schema": { "type": "object", "properties": { "street": { "type": "string" }, "city": { "type": "string" }, "province": { "type": "string" }, "postal_code": { "type": "string" } } } } } }, "responses": { "201": { "description": "success create address", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "number" }, "street": { "type": "string" }, "city": { "type": "string" }, "province": { "type": "string" }, "postal_code": { "type": "string" } } }, "errors": { "type": "object" } } } } } } } }, "get": { "description": "get list of addresses", "responses": { "200": { "description": "success get list of addresses", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "number" }, "street": { "type": "string" }, "city": { "type": "string" }, "province": { "type": "string" }, "postal_code": { "type": "string" } } } }, "errors": { "type": "object" } } } } } } } } }, "/api/contacts/{idContact}/addresses/{idAddress}": { "get": { "description": "get address", "parameters": [ { "schema": { "type": "string" }, "name": "Authorization", "in": "header" }, { "required": true, "schema": { "type": "number" }, "name": "idContact", "in": "path" }, { "required": true, "schema": { "type": "number" }, "name": "idAddress", "in": "path" } ], "responses": { "200": { "description": "success create address", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "number" }, "street": { "type": "string" }, "city": { "type": "string" }, "province": { "type": "string" }, "postal_code": { "type": "string" } } }, "errors": { "type": "object" } } } } } } } }, "put": { "description": "update address", "parameters": [ { "schema": { "type": "string" }, "name": "Authorization", "in": "header" }, { "required": true, "schema": { "type": "number" }, "name": "idContact", "in": "path" }, { "required": true, "schema": { "type": "number" }, "name": "idAddress", "in": "path" } ], "requestBody": { "description": "update existing contact address", "content": { "application/json": { "schema": { "type": "object", "properties": { "street": { "type": "string" }, "city": { "type": "string" }, "province": { "type": "string" }, "postal_code": { "type": "string" } } } } } }, "responses": { "200": { "description": "success update address", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "number" }, "street": { "type": "string" }, "city": { "type": "string" }, "province": { "type": "string" }, "postal_code": { "type": "string" } } }, "errors": { "type": "object" } } } } } } } }, "delete": { "description": "delete address", "responses": { "200": { "description": "success delete address", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "boolean" }, "errors": { "type": "object" } } } } } } } } } } }