From fb19fff9d3704755e2bc9a0037f65856d58958d7 Mon Sep 17 00:00:00 2001 From: Wellington Junior Date: Mon, 13 Nov 2023 16:38:39 -0300 Subject: [PATCH] Refactor property names in swagger.yaml --- backend/docs/docs.go | 149 +++++++++++++++++++++++++------------- backend/docs/swagger.json | 146 +++++++++++++++++++++++++------------ backend/docs/swagger.yaml | 128 ++++++++++++++++++++------------ 3 files changed, 280 insertions(+), 143 deletions(-) diff --git a/backend/docs/docs.go b/backend/docs/docs.go index 0c99db27..1b2d719d 100644 --- a/backend/docs/docs.go +++ b/backend/docs/docs.go @@ -1,5 +1,4 @@ -// Code generated by swaggo/swag. DO NOT EDIT. - +// Package docs Code generated by swaggo/swag. DO NOT EDIT package docs import "github.com/swaggo/swag" @@ -114,7 +113,7 @@ const docTemplate = `{ }, "/assets": { "get": { - "description": "Get all assets", + "description": "Get all assets with optional pagination", "consumes": [ "application/json" ], @@ -125,6 +124,20 @@ const docTemplate = `{ "Assets" ], "summary": "Get all assets", + "parameters": [ + { + "type": "integer", + "description": "Page number", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "Number of items per page", + "name": "limit", + "in": "query" + } + ], "responses": { "200": { "description": "OK", @@ -448,6 +461,44 @@ const docTemplate = `{ } } }, + "/assets/toml": { + "get": { + "description": "Get TOML data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Assets" + ], + "summary": "Get TOML data", + "parameters": [ + { + "type": "string", + "description": "Asset issuer", + "name": "asset_issuer", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/entity.TomlData" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/v1.response" + } + } + } + } + }, "/assets/transfer": { "post": { "description": "Transfer an asset between wallets on Stellar", @@ -2133,37 +2184,37 @@ const docTemplate = `{ "entity.Currency": { "type": "object", "properties": { - "anchorAsset": { + "anchor_asset": { "type": "string" }, - "anchorAssetType": { + "anchor_asset_type": { "type": "string" }, - "approvalCriteria": { + "approval_criteria": { "type": "string" }, - "approvalServer": { + "approval_server": { "type": "string" }, - "attestationOfReserve": { + "attestation_of_reserve": { "type": "string" }, "code": { "type": "string" }, - "collateralAddressMessages": { + "collateral_address_messages": { "type": "array", "items": { "type": "string" } }, - "collateralAddressSignatures": { + "collateral_address_signatures": { "type": "array", "items": { "type": "string" } }, - "collateralAddresses": { + "collateral_addresses": { "type": "array", "items": { "type": "string" @@ -2172,34 +2223,34 @@ const docTemplate = `{ "conditions": { "type": "string" }, - "description": { + "desc": { "type": "string" }, - "displayDecimals": { + "display_decimals": { "type": "integer" }, - "fixedNumber": { + "fixed_number": { "type": "integer" }, "image": { "type": "string" }, - "isAssetAnchored": { + "is_asset_anchored": { "type": "boolean" }, - "isUnlimited": { + "is_unlimited": { "type": "boolean" }, "issuer": { "type": "string" }, - "maxNumber": { + "max_number": { "type": "integer" }, "name": { "type": "string" }, - "redemptionInstructions": { + "redemption_instructions": { "type": "string" }, "regulated": { @@ -2210,43 +2261,43 @@ const docTemplate = `{ "entity.Documentation": { "type": "object", "properties": { - "orgDBA": { + "ORG_DBA": { "type": "string" }, - "orgDescription": { + "ORG_DESCRIPTION": { "type": "string" }, - "orgGithub": { + "ORG_GITHUB": { "type": "string" }, - "orgKeybase": { + "ORG_KEYBASE": { "type": "string" }, - "orgLogo": { + "ORG_LOGO": { "type": "string" }, - "orgName": { + "ORG_NAME": { "type": "string" }, - "orgOfficialEmail": { + "ORG_OFFICIAL_EMAIL": { "type": "string" }, - "orgPhoneNumber": { + "ORG_PHONE_NUMBER": { "type": "string" }, - "orgPhoneNumberAttestation": { + "ORG_PHONE_NUMBER_ATTESTATION": { "type": "string" }, - "orgPhysicalAddress": { + "ORG_PHYSICAL_ADDRESS": { "type": "string" }, - "orgPhysicalAddressAttestation": { + "ORG_PHYSICAL_ADDRESS_ATTESTATION": { "type": "string" }, - "orgTwitter": { + "ORG_TWITTER": { "type": "string" }, - "orgURL": { + "ORG_URL": { "type": "string" } } @@ -2346,7 +2397,7 @@ const docTemplate = `{ "github": { "type": "string" }, - "idphotoHash": { + "id_photo_hash": { "type": "string" }, "keybase": { @@ -2358,7 +2409,7 @@ const docTemplate = `{ "twitter": { "type": "string" }, - "verificationPhotoHash": { + "verification_photo_hash": { "type": "string" } } @@ -2453,49 +2504,49 @@ const docTemplate = `{ "entity.TomlData": { "type": "object", "properties": { - "accounts": { + "ACCOUNTS": { "type": "array", "items": { "type": "string" } }, - "currencies": { + "CURRENCIES": { "type": "array", "items": { "$ref": "#/definitions/entity.Currency" } }, - "documentation": { + "DOCUMENTATION": { "$ref": "#/definitions/entity.Documentation" }, - "federationServer": { + "FEDERATION_SERVER": { "type": "string" }, - "horizonURL": { + "HORIZON_URL": { "type": "string" }, - "networkPassphrase": { + "NETWORK_PASSPHRASE": { "type": "string" }, - "principals": { + "PRINCIPALS": { "type": "array", "items": { "$ref": "#/definitions/entity.Principal" } }, - "signingKey": { + "SIGNING_KEY": { "type": "string" }, - "transferServer": { + "TRANSFER_SERVER": { "type": "string" }, - "validators": { + "VALIDATORS": { "type": "array", "items": { "$ref": "#/definitions/entity.Validator" } }, - "version": { + "VERSION": { "type": "string" } } @@ -2579,19 +2630,19 @@ const docTemplate = `{ "entity.Validator": { "type": "object", "properties": { - "alias": { + "ALIAS": { "type": "string" }, - "displayName": { + "DISPLAY_NAME": { "type": "string" }, - "history": { + "HISTORY": { "type": "string" }, - "host": { + "HOST": { "type": "string" }, - "publicKey": { + "PUBLIC_KEY": { "type": "string" } } diff --git a/backend/docs/swagger.json b/backend/docs/swagger.json index 87ce2d4b..8db8692b 100644 --- a/backend/docs/swagger.json +++ b/backend/docs/swagger.json @@ -102,7 +102,7 @@ }, "/assets": { "get": { - "description": "Get all assets", + "description": "Get all assets with optional pagination", "consumes": [ "application/json" ], @@ -113,6 +113,20 @@ "Assets" ], "summary": "Get all assets", + "parameters": [ + { + "type": "integer", + "description": "Page number", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "Number of items per page", + "name": "limit", + "in": "query" + } + ], "responses": { "200": { "description": "OK", @@ -436,6 +450,44 @@ } } }, + "/assets/toml": { + "get": { + "description": "Get TOML data", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Assets" + ], + "summary": "Get TOML data", + "parameters": [ + { + "type": "string", + "description": "Asset issuer", + "name": "asset_issuer", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/entity.TomlData" + } + }, + "500": { + "description": "Internal Server Error", + "schema": { + "$ref": "#/definitions/v1.response" + } + } + } + } + }, "/assets/transfer": { "post": { "description": "Transfer an asset between wallets on Stellar", @@ -2121,37 +2173,37 @@ "entity.Currency": { "type": "object", "properties": { - "anchorAsset": { + "anchor_asset": { "type": "string" }, - "anchorAssetType": { + "anchor_asset_type": { "type": "string" }, - "approvalCriteria": { + "approval_criteria": { "type": "string" }, - "approvalServer": { + "approval_server": { "type": "string" }, - "attestationOfReserve": { + "attestation_of_reserve": { "type": "string" }, "code": { "type": "string" }, - "collateralAddressMessages": { + "collateral_address_messages": { "type": "array", "items": { "type": "string" } }, - "collateralAddressSignatures": { + "collateral_address_signatures": { "type": "array", "items": { "type": "string" } }, - "collateralAddresses": { + "collateral_addresses": { "type": "array", "items": { "type": "string" @@ -2160,34 +2212,34 @@ "conditions": { "type": "string" }, - "description": { + "desc": { "type": "string" }, - "displayDecimals": { + "display_decimals": { "type": "integer" }, - "fixedNumber": { + "fixed_number": { "type": "integer" }, "image": { "type": "string" }, - "isAssetAnchored": { + "is_asset_anchored": { "type": "boolean" }, - "isUnlimited": { + "is_unlimited": { "type": "boolean" }, "issuer": { "type": "string" }, - "maxNumber": { + "max_number": { "type": "integer" }, "name": { "type": "string" }, - "redemptionInstructions": { + "redemption_instructions": { "type": "string" }, "regulated": { @@ -2198,43 +2250,43 @@ "entity.Documentation": { "type": "object", "properties": { - "orgDBA": { + "ORG_DBA": { "type": "string" }, - "orgDescription": { + "ORG_DESCRIPTION": { "type": "string" }, - "orgGithub": { + "ORG_GITHUB": { "type": "string" }, - "orgKeybase": { + "ORG_KEYBASE": { "type": "string" }, - "orgLogo": { + "ORG_LOGO": { "type": "string" }, - "orgName": { + "ORG_NAME": { "type": "string" }, - "orgOfficialEmail": { + "ORG_OFFICIAL_EMAIL": { "type": "string" }, - "orgPhoneNumber": { + "ORG_PHONE_NUMBER": { "type": "string" }, - "orgPhoneNumberAttestation": { + "ORG_PHONE_NUMBER_ATTESTATION": { "type": "string" }, - "orgPhysicalAddress": { + "ORG_PHYSICAL_ADDRESS": { "type": "string" }, - "orgPhysicalAddressAttestation": { + "ORG_PHYSICAL_ADDRESS_ATTESTATION": { "type": "string" }, - "orgTwitter": { + "ORG_TWITTER": { "type": "string" }, - "orgURL": { + "ORG_URL": { "type": "string" } } @@ -2334,7 +2386,7 @@ "github": { "type": "string" }, - "idphotoHash": { + "id_photo_hash": { "type": "string" }, "keybase": { @@ -2346,7 +2398,7 @@ "twitter": { "type": "string" }, - "verificationPhotoHash": { + "verification_photo_hash": { "type": "string" } } @@ -2441,49 +2493,49 @@ "entity.TomlData": { "type": "object", "properties": { - "accounts": { + "ACCOUNTS": { "type": "array", "items": { "type": "string" } }, - "currencies": { + "CURRENCIES": { "type": "array", "items": { "$ref": "#/definitions/entity.Currency" } }, - "documentation": { + "DOCUMENTATION": { "$ref": "#/definitions/entity.Documentation" }, - "federationServer": { + "FEDERATION_SERVER": { "type": "string" }, - "horizonURL": { + "HORIZON_URL": { "type": "string" }, - "networkPassphrase": { + "NETWORK_PASSPHRASE": { "type": "string" }, - "principals": { + "PRINCIPALS": { "type": "array", "items": { "$ref": "#/definitions/entity.Principal" } }, - "signingKey": { + "SIGNING_KEY": { "type": "string" }, - "transferServer": { + "TRANSFER_SERVER": { "type": "string" }, - "validators": { + "VALIDATORS": { "type": "array", "items": { "$ref": "#/definitions/entity.Validator" } }, - "version": { + "VERSION": { "type": "string" } } @@ -2567,19 +2619,19 @@ "entity.Validator": { "type": "object", "properties": { - "alias": { + "ALIAS": { "type": "string" }, - "displayName": { + "DISPLAY_NAME": { "type": "string" }, - "history": { + "HISTORY": { "type": "string" }, - "host": { + "HOST": { "type": "string" }, - "publicKey": { + "PUBLIC_KEY": { "type": "string" } } diff --git a/backend/docs/swagger.yaml b/backend/docs/swagger.yaml index 6ccb6ea6..11e8d0fd 100644 --- a/backend/docs/swagger.yaml +++ b/backend/docs/swagger.yaml @@ -51,82 +51,82 @@ definitions: type: object entity.Currency: properties: - anchorAsset: + anchor_asset: type: string - anchorAssetType: + anchor_asset_type: type: string - approvalCriteria: + approval_criteria: type: string - approvalServer: + approval_server: type: string - attestationOfReserve: + attestation_of_reserve: type: string code: type: string - collateralAddressMessages: + collateral_address_messages: items: type: string type: array - collateralAddressSignatures: + collateral_address_signatures: items: type: string type: array - collateralAddresses: + collateral_addresses: items: type: string type: array conditions: type: string - description: + desc: type: string - displayDecimals: + display_decimals: type: integer - fixedNumber: + fixed_number: type: integer image: type: string - isAssetAnchored: + is_asset_anchored: type: boolean - isUnlimited: + is_unlimited: type: boolean issuer: type: string - maxNumber: + max_number: type: integer name: type: string - redemptionInstructions: + redemption_instructions: type: string regulated: type: boolean type: object entity.Documentation: properties: - orgDBA: + ORG_DBA: type: string - orgDescription: + ORG_DESCRIPTION: type: string - orgGithub: + ORG_GITHUB: type: string - orgKeybase: + ORG_KEYBASE: type: string - orgLogo: + ORG_LOGO: type: string - orgName: + ORG_NAME: type: string - orgOfficialEmail: + ORG_OFFICIAL_EMAIL: type: string - orgPhoneNumber: + ORG_PHONE_NUMBER: type: string - orgPhoneNumberAttestation: + ORG_PHONE_NUMBER_ATTESTATION: type: string - orgPhysicalAddress: + ORG_PHYSICAL_ADDRESS: type: string - orgPhysicalAddressAttestation: + ORG_PHYSICAL_ADDRESS_ATTESTATION: type: string - orgTwitter: + ORG_TWITTER: type: string - orgURL: + ORG_URL: type: string type: object entity.Key: @@ -197,7 +197,7 @@ definitions: type: string github: type: string - idphotoHash: + id_photo_hash: type: string keybase: type: string @@ -205,7 +205,7 @@ definitions: type: string twitter: type: string - verificationPhotoHash: + verification_photo_hash: type: string type: object entity.Role: @@ -269,35 +269,35 @@ definitions: type: object entity.TomlData: properties: - accounts: + ACCOUNTS: items: type: string type: array - currencies: + CURRENCIES: items: $ref: '#/definitions/entity.Currency' type: array - documentation: + DOCUMENTATION: $ref: '#/definitions/entity.Documentation' - federationServer: + FEDERATION_SERVER: type: string - horizonURL: + HORIZON_URL: type: string - networkPassphrase: + NETWORK_PASSPHRASE: type: string - principals: + PRINCIPALS: items: $ref: '#/definitions/entity.Principal' type: array - signingKey: + SIGNING_KEY: type: string - transferServer: + TRANSFER_SERVER: type: string - validators: + VALIDATORS: items: $ref: '#/definitions/entity.Validator' type: array - version: + VERSION: type: string type: object entity.User: @@ -352,15 +352,15 @@ definitions: type: object entity.Validator: properties: - alias: + ALIAS: type: string - displayName: + DISPLAY_NAME: type: string - history: + HISTORY: type: string - host: + HOST: type: string - publicKey: + PUBLIC_KEY: type: string type: object entity.Vault: @@ -774,7 +774,16 @@ paths: get: consumes: - application/json - description: Get all assets + description: Get all assets with optional pagination + parameters: + - description: Page number + in: query + name: page + type: integer + - description: Number of items per page + in: query + name: limit + type: integer produces: - application/json responses: @@ -1048,6 +1057,31 @@ paths: summary: Mint an asset tags: - Assets + /assets/toml: + get: + consumes: + - application/json + description: Get TOML data + parameters: + - description: Asset issuer + in: path + name: asset_issuer + required: true + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + $ref: '#/definitions/entity.TomlData' + "500": + description: Internal Server Error + schema: + $ref: '#/definitions/v1.response' + summary: Get TOML data + tags: + - Assets /assets/transfer: post: consumes: