{ "openapi": "3.1.0", "info": { "title": "Address API", "description": "Address API", "version": "1.0.0" }, "servers": [ { "url": "http://contact-management-restful-api.test" } ], "paths": { "/api/contacts/{idContact}/addresses": { "post": { "description": "Create new address", "parameters": [ { "name": "Authorization", "in": "header" }, { "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" }, "country": { "type": "string" }, "postalCode": { "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" }, "country": { "type": "string" }, "postalCode": { "type": "string" } } }, "error": { "type": "object" } } } } } } } }, "get": { "description": "Get list addresses", "responses": { "200": { "description": "List addresses", "content": { "application/json": { "schema": { "type": "obejct", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "number" }, "street": { "type": "string" }, "city": { "type": "string" }, "province": { "type": "string" }, "country": { "type": "string" }, "postalCode": { "type": "string" } } } }, "error": { "type": "object" } } } } } } } } }, "/api/contacts/{idContact}/addresses/{idAddress}": { "get": { "description": "Get address", "parameters": [ { "name": "Authorization", "in": "header" }, { "name": "idContact", "in": "path" }, { "name": "idAddress", "in": "path" } ], "responses": { "200": { "description": "Success get address", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "object", "properties": { "id": { "type": "number" }, "street": { "type": "string" }, "city": { "type": "string" }, "province": { "type": "string" }, "country": { "type": "string" }, "postalCode": { "type": "string" } } }, "error": { "type": "object" } } } } } } } }, "put": { "description": "Update address", "parameters": [ { "name": "Authorization", "in": "header" }, { "name": "idContact", "in": "path" }, { "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" }, "country": { "type": "string" }, "postalCode": { "type": "string" } } } } } }, "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" }, "country": { "type": "string" }, "postalCode": { "type": "string" } } }, "error": { "type": "object" } } } } } } } }, "delete": { "description": "Delete address", "parameters": [ { "name": "Authorization", "in": "header" }, { "name": "idContact", "in": "path" }, { "name": "idAddress", "in": "path" } ], "responses": { "200": { "description": "Success delete address", "content": { "application/json": { "schema": { "type": "object", "properties": { "data": { "type": "boolean" }, "error": { "type": "object" } } } } } } } } } } }