diff --git a/openapi/account.yml b/openapi/account.yml deleted file mode 100644 index b860838be..000000000 --- a/openapi/account.yml +++ /dev/null @@ -1,92 +0,0 @@ -openapi: 3.0.3 -info: - title: Horizon Account API - version: 0.0.1 - -tags: - - name: account - description: Users interact with the Stellar network through accounts. Everything else in the ledger—assets, offers, trustlines, etc. are owned by accounts, and accounts must authorize all changes to the ledger through signed transactions. - externalDocs: - description: Learn more about accounts here - url: https://developers.stellar.org/docs/glossary/accounts/ - -paths: - - /accounts/{account_id}/operations: - get: - tags: - - account - summary: Get operations by account_id and paged list - description: This endpoint represents successful operations for a given account and can be used in streaming mode. Streaming mode allows you to listen for new operations for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known operation unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream operations created since your request time. - operationId: GetOperationsByAccountid - parameters: - - $ref: '#/components/parameters/AccountIDParam' - - $ref: '#/components/parameters/CursorParam' - - $ref: '#/components/parameters/OrderParam' - - $ref: '#/components/parameters/LimitParam' - - $ref: '#/components/parameters/IncludeFailedParam' - responses: - '200': - description: OK - - /accounts/{account_id}: - get: - tags: - - account - summary: Retrieves information about a specific account - description: The single account endpoint provides information on a specific account. - The balances section in the response will also list all the trustlines this account has established, including trustlines that haven’t been authorized yet. - operationId: RetrieveAnAccount - parameters: - - $ref: '#/components/parameters/AccountIDParam' - responses: - '200': - description: OK - -components: - parameters: - CursorParam: - name: cursor - in: query - required: false - description: A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record. - schema: - type: integer - example: 6606617478959105 - LimitParam: - name: limit - in: query - required: false - description: The maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. - schema: - type: integer - example: 10 - AccountIDParam: - name: account_id - in: path - required: true - description: This account’s public key encoded in a base32 string representation. - schema: - type: string - example: GDMQQNJM4UL7QIA66P7R2PZHMQINWZBM77BEBMHLFXD5JEUAHGJ7R4JZ - OrderParam: - name: order - in: query - required: false - description: A designation of the order in which records should appear. Options include asc (ascending) or desc (descending). If this argument isn’t set, it defaults to asc. - schema: - type: integer - enum: - - asc - - desc - IncludeFailedParam: - name: includefailed - in: query - required: false - description: Set to true to include failed operations in results. Options include true and false. - schema: - type: boolean - enum: - - true - - false - \ No newline at end of file diff --git a/openapi/bundled.yml b/openapi/bundled.yml new file mode 100644 index 000000000..23d3ebbaf --- /dev/null +++ b/openapi/bundled.yml @@ -0,0 +1,1226 @@ +openapi: 3.0.3 +info: + title: Horizon + version: 0.0.1 +servers: + - url: https://horizon.stellar.org + description: The main network + - url: https://horizon-testnet.stellar.org + description: The test network +tags: + - name: Accounts + description: Users interact with the Stellar network through accounts. Everything else in the ledger—assets, offers, trustlines, etc. are owned by accounts, and accounts must authorize all changes to the ledger through signed transactions. + - name: Assets + description: Assets are representations of value issued on the Stellar network. An asset consists of a type, code, and issuer. + - name: Offers + description: Offers are statements about how much of an asset an account wants to buy or sell. + - name: Trades + description: When an offer is fully or partially fulfilled, a trade happens. Trades can also be caused by successful path payments, because path payments involve fulfilling offers. A trade occurs between two parties—base and counter. Which is which is either arbitrary or determined by the calling query. +paths: + /accounts: + get: + tags: + - Accounts + summary: List all Accounts + description: 'This endpoint lists accounts by one of four filters : signer, asset, liquidity pool or sponsor.' + operationId: ListAllAccounts + parameters: + - $ref: '#/components/parameters/SponsorParam' + - $ref: '#/components/parameters/AssetParam' + - $ref: '#/components/parameters/SignerParam' + - $ref: '#/components/parameters/LiquidityPoolParam' + - $ref: '#/components/parameters/CursorParam' + - $ref: '#/components/parameters/OrderParam' + - $ref: '#/components/parameters/LimitParam' + responses: + '200': + description: 'Returns accounts based on provided filter: signer , asset, sponser or liquidity pool' + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Links' + - $ref: '#/components/schemas/Account' + /accounts/{account_id}: + get: + tags: + - Accounts + summary: Retrieve an Account + description: The single account endpoint provides information on a specific account. The balances section in the response will also list all the trustlines this account has established, including trustlines that haven’t been authorized yet. + operationId: RetrieveAnAccount + parameters: + - $ref: '#/components/parameters/AccountIDParam' + responses: + '200': + description: Returns details like balances, sponserships etc. about an account. + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/AccountLink' + - $ref: '#/components/schemas/Account' + /accounts/{account_id}/transactions: + get: + tags: + - Accounts + summary: Retrieve an Account's Transactions + description: This endpoint represents successful transactions for a given account and can be used in streaming mode. Streaming mode allows you to listen for new transactions for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known transaction unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream transactions created since your request time. + operationId: GetTransactionsByAccountid + parameters: + - $ref: '#/components/parameters/AccountIDParam' + - $ref: '#/components/parameters/CursorParam' + - $ref: '#/components/parameters/OrderParam' + - $ref: '#/components/parameters/LimitParam' + - $ref: '#/components/parameters/IncludeFailedParam' + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Links' + - $ref: '#/components/schemas/Transaction' + /accounts/{account_id}/operations: + get: + tags: + - Accounts + summary: Retrieve an Account's Operations + description: This endpoint represents successful operations for a given account and can be used in streaming mode. Streaming mode allows you to listen for new operations for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known operation unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream operations created since your request time. + operationId: GetOperationsByAccountid + parameters: + - $ref: '#/components/parameters/AccountIDParam' + - $ref: '#/components/parameters/CursorParam' + - $ref: '#/components/parameters/OrderParam' + - $ref: '#/components/parameters/LimitParam' + - $ref: '#/components/parameters/IncludeFailedParam' + - $ref: '#/components/parameters/JoinParam' + responses: + '200': + description: OK + /accounts/{account_id}/payments: + get: + tags: + - Accounts + summary: Retrieve an Account's Payments + description: This endpoint represents successful payments for a given account and can be used in streaming mode. Streaming mode allows you to listen for new payments for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known payment unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream payments created since your request time. + operationId: GetPaymentsbyAccountid + parameters: + - $ref: '#/components/parameters/AccountIDParam' + - $ref: '#/components/parameters/CursorParam' + - $ref: '#/components/parameters/OrderParam' + - $ref: '#/components/parameters/LimitParam' + - $ref: '#/components/parameters/IncludeFailedParam' + - $ref: '#/components/parameters/JoinParam' + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Links' + - $ref: '#/components/schemas/Payment' + /accounts/{account_id}/effects: + get: + tags: + - Accounts + summary: Retrieve an Account's Effects + description: This endpoint returns the effects of a specific account and can be used in streaming mode. Streaming mode allows you to listen for new effects for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known effect unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream effects created since your request time. + operationId: GetEffectsbyAccountid + parameters: + - $ref: '#/components/parameters/AccountIDParam' + - $ref: '#/components/parameters/CursorParam' + - $ref: '#/components/parameters/OrderParam' + - $ref: '#/components/parameters/LimitParam' + responses: + '200': + description: OK + /accounts/{account_id}/offers: + get: + tags: + - Accounts + summary: Retrieve an Account's Offers + description: This endpoint represents all offers a given account has currently open and can be used in streaming mode. Streaming mode allows you to listen for new offers for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known offer unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream offers created since your request time. + operationId: GetOffersbyAccountid + parameters: + - $ref: '#/components/parameters/AccountIDParam' + - $ref: '#/components/parameters/CursorParam' + - $ref: '#/components/parameters/OrderParam' + - $ref: '#/components/parameters/LimitParam' + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Links' + - $ref: '#/components/schemas/Offer' + /accounts/{account_id}/trades: + get: + tags: + - Accounts + summary: Retrieve an Account's Trades + description: This endpoint represents all trades for a given account and can be used in streaming mode. Streaming mode allows you to listen for trades for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known trade unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream trades created since your request time. + operationId: GetTradesbyAccountid + parameters: + - $ref: '#/components/parameters/AccountIDParam' + - $ref: '#/components/parameters/CursorParam' + - $ref: '#/components/parameters/OrderParam' + - $ref: '#/components/parameters/LimitParam' + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Links' + - $ref: '#/components/schemas/Trade' + /accounts/{account_id}/data/{key}: + get: + tags: + - Accounts + summary: Retrieve an Account's Data + description: This endpoint represents a single data for a given account. + operationId: GetDatabyAccountid + parameters: + - $ref: '#/components/parameters/AccountIDParam' + - $ref: '#/components/parameters/DataParam' + responses: + '200': + description: blank + content: + application/json: + schema: + type: object + properties: + value: + type: string + /offers: + get: + tags: + - Offers + summary: List All Offers + description: This endpoint lists all currently open offers and can be used in streaming mode. Streaming mode allows you to listen for new offers as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known offer unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream offers created since your request time. When filtering by buying or selling arguments, you must use a combination of selling_asset_type, selling_asset_issuer, and selling_asset_code for the selling asset, or a combination of buying_asset_type, buying_asset_issuer, and buying_asset_code for the buying asset. + operationId: GetAllOffers + parameters: + - $ref: '#/components/parameters/SponsorParam' + - $ref: '#/components/parameters/SellerParam' + - $ref: '#/components/parameters/SellingAssetTypeParam' + - $ref: '#/components/parameters/SellingAssetIssuerParam' + - $ref: '#/components/parameters/SellingAssetCodeParam' + - $ref: '#/components/parameters/BuyingAssetTypeParam' + - $ref: '#/components/parameters/BuyingAssetIssuerParam' + - $ref: '#/components/parameters/BuyingAssetCodeParam' + - $ref: '#/components/parameters/CursorParam' + - $ref: '#/components/parameters/OrderParam' + - $ref: '#/components/parameters/LimitParam' + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Links' + - $ref: '#/components/schemas/Offer' + /offers/{offer_id}: + get: + tags: + - Offers + summary: Retrieve an Offer + description: The single offer endpoint provides information on a specific offer. + operationId: GetOfferbyOfferid + parameters: + - $ref: '#/components/parameters/OfferIDParam' + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Links' + - $ref: '#/components/schemas/Offer' + /offers/{offer_id}/trades: + get: + tags: + - Offers + summary: Retrieve an Account's Trades + description: This endpoint represents all trades for a given offer and can be used in streaming mode. Streaming mode allows you to listen for trades for this offer as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known trade unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream trades created since your request time. + operationId: GetTradebyOfferid + parameters: + - $ref: '#/components/parameters/OfferIDParam' + - $ref: '#/components/parameters/CursorParam' + - $ref: '#/components/parameters/OrderParam' + - $ref: '#/components/parameters/LimitParam' + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Links' + - $ref: '#/components/schemas/Trade' + /trades: + get: + tags: + - Trades + summary: List All Trades + description: 'This endpoint lists all trades and can be used in streaming mode. Streaming mode allows you to listen for new trades as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known trade unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream trades created since your request time. When filtering for a specific orderbook, you must use use all six of these arguments: base_asset_type, base_asset_issuer, base_asset_code, counter_asset_type, counter_asset_issuer, and counter_asset_code. If the base or counter asset is XLM, you only need to indicate the asset type as native and do not need to designate the code or the issuer.' + operationId: GetAllTrades + parameters: + - $ref: '#/components/parameters/OfferIdParam' + - $ref: '#/components/parameters/BaseAssetTypeParam' + - $ref: '#/components/parameters/BaseAssetIssuerParam' + - $ref: '#/components/parameters/BaseAssetCodeParam' + - $ref: '#/components/parameters/CounterAssetTypeParam' + - $ref: '#/components/parameters/CounterAssetIssuerParam' + - $ref: '#/components/parameters/CounterAssetCodeParam' + - $ref: '#/components/parameters/TradeTypeParam' + - $ref: '#/components/parameters/CursorParam' + - $ref: '#/components/parameters/OrderParam' + - $ref: '#/components/parameters/LimitParam' + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/Links' + - $ref: '#/components/schemas/Trade' +components: + parameters: + SponsorParam: + name: sponser + in: query + required: false + description: Account ID of the sponsor. Every account in the response will either be sponsored by the given account ID or have a subentry (trustline, offer, or data entry) which is sponsored by the given account ID. + schema: + type: string + example: GDMQQNJM4UL7QIA66P7R2PZHMQINWZBM77BEBMHLFXD5JEUAHGJ7R4JZ + AssetParam: + name: asset + in: query + required: false + description: An issued asset represented as “Code:IssuerAccountID”. Every account in the response will have a trustline for the given asset. + SignerParam: + name: signer + in: query + required: false + description: Account ID of the signer. Every account in the response will have the given account ID as a signer. + schema: + type: string + example: GDMQQNJM4UL7QIA66P7R2PZHMQINWZBM77BEBMHLFXD5JEUAHGJ7R4JZ + LiquidityPoolParam: + name: liqudity_pool + in: query + required: false + description: With this parameter, the results will include only accounts which have trustlines to the specified liquidity pool. + CursorParam: + name: cursor + in: query + required: false + description: A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record. + schema: + type: integer + example: 6606617478959105 + OrderParam: + name: order + in: query + required: false + description: A designation of the order in which records should appear. Options include asc (ascending) or desc (descending). If this argument isn’t set, it defaults to asc. + schema: + type: string + enum: + - asc + - desc + LimitParam: + name: limit + in: query + required: false + description: The maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. + schema: + type: integer + example: 10 + AccountIDParam: + name: account_id + in: path + required: true + description: This account’s public key encoded in a base32 string representation. + schema: + type: string + example: GDMQQNJM4UL7QIA66P7R2PZHMQINWZBM77BEBMHLFXD5JEUAHGJ7R4JZ + IncludeFailedParam: + name: includefailed + in: query + required: false + description: Set to true to include failed operations in results. Options include true and false. + schema: + type: boolean + enum: + - true + - false + JoinParam: + name: join + in: query + required: false + description: Set to transactions to include the transactions which created each of the operations in the response. + DataParam: + name: key + in: path + required: true + description: The key name for this data. + schema: + type: string + example: config.memo_required + SellerParam: + name: seller + in: query + required: false + description: The account ID of the offer creator. + SellingAssetTypeParam: + name: selling_asset_type + in: query + required: false + description: The type for the selling asset. Either native, credit_alphanum4, or credit_alphanum12. + schema: + type: string + enum: + - native + - credit_alphanum4 + - credit_alphanum12 + SellingAssetIssuerParam: + name: selling_asset_issuer + in: query + required: false + description: The Stellar address of the selling asset’s issuer. + SellingAssetCodeParam: + name: selling_asset_code + in: query + required: false + description: The code for the selling asset. + BuyingAssetTypeParam: + name: buying_asset_type + in: query + required: false + description: The type for the buying asset. Either native, credit_alphanum4, or credit_alphanum12. + schema: + type: string + enum: + - native + - credit_alphanum4 + - credit_alphanum12 + BuyingAssetIssuerParam: + name: buying_asset_issuer + in: query + required: false + description: The Stellar address of the buying asset’s issuer. + BuyingAssetCodeParam: + name: buying_asset_code + in: query + required: false + description: The code for the buying asset. + OfferIDParam: + name: offer_id + in: path + required: true + description: A unique identifier for this offer. + OfferIdParam: + name: offer_id + in: query + required: false + description: The offer ID. Used to filter for trades originating from a specific offer. + BaseAssetTypeParam: + name: base_asset_type + in: query + required: false + description: The type for the base asset. Either native, credit_alphanum4, or credit_alphanum12. + schema: + type: string + enum: + - native + - credit_alphanum4 + - credit_alphanum12 + BaseAssetIssuerParam: + name: base_asset_issuer + in: query + required: false + description: The Stellar address of the base asset’s issuer. + schema: + type: string + example: GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX + BaseAssetCodeParam: + name: base_asset_code + in: query + required: false + description: The code for the base asset. + schema: + type: string + example: USD + CounterAssetTypeParam: + name: counter_asset_type + in: query + required: false + description: The type for the counter asset. Either native, credit_alphanum4, or credit_alphanum12. + schema: + type: string + enum: + - native + - credit_alphanum4 + - credit_alphanum12 + CounterAssetIssuerParam: + name: counter_asset_issuer + in: query + required: false + description: The Stellar address of the counter asset’s issuer. + schema: + type: string + example: GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX + CounterAssetCodeParam: + name: counter_asset_code + in: query + required: false + description: The code for the counter asset. + TradeTypeParam: + name: trade_type + in: query + required: false + description: Can be set to all, orderbook, or liquidity_pools to filter only trades executed across a given mechanism. + schema: + type: string + enum: + - all + - orderbook + - liquidity_pools + schemas: + link: + type: object + properties: + href: + type: string + format: link + templated: + type: boolean + required: + - href + Links: + type: object + properties: + _links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + next: + $ref: '#/components/schemas/link' + prev: + $ref: '#/components/schemas/link' + id: + type: string + address: + type: string + pattern: G[A-Z0-9]{55} + sequence: + type: string + pattern: '[0-9]+' + sequence_ledger: + type: integer + format: uint32 + subentry_count: + type: integer + format: int32 + last_modified_ledger: + type: integer + format: uint32 + thresholds: + type: object + properties: + low_threshold: + type: integer + med_threshold: + type: integer + high_threshold: + type: integer + flags: + type: object + properties: + auth_required: + type: boolean + auth_revocable: + type: boolean + auth_immutable: + type: boolean + auth_clawback_enabled: + type: boolean + currency: + type: string + pattern: '[0-9]+\.[0-9]{7}' + BalanceLineNative: + type: object + properties: + balance: + $ref: '#/components/schemas/currency' + liquidity_pool_id: + type: string + limit: + $ref: '#/components/schemas/currency' + buying_liabilites: + $ref: '#/components/schemas/currency' + selling_liabilites: + $ref: '#/components/schemas/currency' + sponser: + type: string + last_modified_ledger: + $ref: '#/components/schemas/last_modified_ledger' + is_authorized: + type: boolean + is_authorized_to_maintain_liabilites: + type: boolean + is_clawback_enabled: + type: boolean + asset_type: + type: string + enum: + - native + required: + - balance + - limit + - asset_type + - buying_liabilites + - selling_liabilites + - last_modified_ledger + - is_authorized + - is_authorized_to_maintain_liabilites + - is_clawback_enabled + BalanceLineAsset: + type: object + properties: + balance: + $ref: '#/components/schemas/currency' + limit: + $ref: '#/components/schemas/currency' + buying_liabilites: + $ref: '#/components/schemas/currency' + selling_liabilites: + $ref: '#/components/schemas/currency' + sponser: + $ref: '#/components/schemas/address' + last_modified_ledger: + $ref: '#/components/schemas/last_modified_ledger' + is_authorized: + type: boolean + is_authorized_to_maintain_liabilites: + type: boolean + is_clawback_enabled: + type: boolean + asset_type: + type: string + enum: + - credit_alphanum4 + - credit_alphanum12 + asset_code: + type: string + asset_issuer: + $ref: '#/components/schemas/address' + required: + - balance + - limit + - asset_type + - asset_code + - asset_issuer + - buying_liabilites + - selling_liabilites + - last_modified_ledger + - is_authorized + - is_authorized_to_maintain_liabilites + - is_clawback_enabled + BalanceLineLiquidityPool: + type: object + properties: + liquidity_pool_id: + type: string + asset_type: + type: string + enum: + - liquidity_pool_shares + balance: + $ref: '#/components/schemas/currency' + limit: + $ref: '#/components/schemas/currency' + last_modified_ledger: + $ref: '#/components/schemas/last_modified_ledger' + sponser: + $ref: '#/components/schemas/address' + is_authorized: + type: boolean + is_authorized_to_maintain_liabilites: + type: boolean + is_clawback_enabled: + type: boolean + required: + - liquidity_pool_id + - balance + - limit + - asset_type + - last_modified_ledger + - is_authorized + - is_authorized_to_maintain_liabilites + - is_clawback_enabled + signers: + type: object + properties: + key: + $ref: '#/components/schemas/address' + weight: + type: integer + format: int32 + type: + type: string + enum: + - ed25519_public_key + - sha256_hash + - preauth_tx + sponser: + $ref: '#/components/schemas/address' + required: + - key + - weight + - type + Account: + type: object + properties: + _embedded: + type: object + properties: + records: + type: array + items: + type: object + properties: + _links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + transactions: + $ref: '#/components/schemas/link' + operations: + $ref: '#/components/schemas/link' + payments: + $ref: '#/components/schemas/link' + effects: + $ref: '#/components/schemas/link' + offers: + $ref: '#/components/schemas/link' + trades: + $ref: '#/components/schemas/link' + data: + $ref: '#/components/schemas/link' + required: + - self + - transactions + - operations + - payments + - effects + - offers + - trades + - data + id: + $ref: '#/components/schemas/id' + account_id: + $ref: '#/components/schemas/address' + sequence: + $ref: '#/components/schemas/sequence' + sequence_ledger: + $ref: '#/components/schemas/sequence_ledger' + sequence_time: + type: string + subentry_count: + $ref: '#/components/schemas/subentry_count' + inflation_destination: + $ref: '#/components/schemas/address' + home_domain: + type: string + last_modified_ledger: + $ref: '#/components/schemas/last_modified_ledger' + last_modified_time: + type: string + thresholds: + $ref: '#/components/schemas/thresholds' + flags: + $ref: '#/components/schemas/flags' + balances: + type: array + items: + anyOf: + - $ref: '#/components/schemas/BalanceLineNative' + - $ref: '#/components/schemas/BalanceLineAsset' + - $ref: '#/components/schemas/BalanceLineLiquidityPool' + signers: + type: array + items: + $ref: '#/components/schemas/signers' + data: + type: object + num_sponsoring: + type: integer + num_sponsered: + type: integer + sponser: + $ref: '#/components/schemas/address' + paging_token: + type: string + required: + - id + - account_id + - sequence + - subentry_count + - last_modified_ledger + - last_modified_time + - thresholds + - flags + - balances + - signers + - data + - num_sponsoring + - num_sponsered + - paging_token + AccountLink: + type: object + properties: + _embedded: + type: object + properties: + records: + type: array + items: + type: object + properties: + _links: + type: object + properties: + self: + $ref: ../instance_variables.yml#/components/schemas/link + transactions: + $ref: ../instance_variables.yml#/components/schemas/link + operations: + $ref: ../instance_variables.yml#/components/schemas/link + payments: + $ref: ../instance_variables.yml#/components/schemas/link + effects: + $ref: ../instance_variables.yml#/components/schemas/link + offers: + $ref: ../instance_variables.yml#/components/schemas/link + trades: + $ref: ../instance_variables.yml#/components/schemas/link + data: + $ref: ../instance_variables.yml#/components/schemas/link + $ref: '#/components/schemas/Account' + required: + - self + - transactions + - operations + - payments + - effects + - offers + - trades + - data + signatures: + type: array + items: + type: string + pattern: G[A-Z0-9]{55} + TransactionPreconditionsTimebounds: + type: object + properties: + min_time: + type: string + max_time: + type: string + TransactionPreconditionsLedgerbounds: + type: object + properties: + min_ledger: + type: string + max_ledger: + type: string + TransactionPreconditions: + type: object + properties: + timebounds: + $ref: '#/components/schemas/TransactionPreconditionsTimebounds' + ledgerbounds: + $ref: '#/components/schemas/TransactionPreconditionsLedgerbounds' + min_account_sequence: + type: string + min_account_sequence_age: + type: string + min_account_sequence_ledger_gap: + type: integer + format: uint32 + extra_signers: + type: array + items: + type: string + hash: + type: string + FeeBumpTransaction: + type: object + properties: + hash: + $ref: '#/components/schemas/hash' + signatures: + $ref: '#/components/schemas/signatures' + InnerTransaction: + type: object + properties: + hash: + $ref: '#/components/schemas/hash' + signatures: + $ref: '#/components/schemas/signatures' + max_fee: + type: string + Transaction: + type: object + properties: + _embedded: + type: object + properties: + records: + type: array + items: + type: object + properties: + memo: + type: string + memo_bytes: + type: string + _links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + account: + $ref: '#/components/schemas/link' + ledger: + $ref: '#/components/schemas/link' + operations: + $ref: '#/components/schemas/link' + effects: + $ref: '#/components/schemas/link' + precedes: + $ref: '#/components/schemas/link' + succeeds: + $ref: '#/components/schemas/link' + transaction: + $ref: '#/components/schemas/link' + required: + - self + - account + - ledger + - operations + - effects + - precedes + - succeeds + - transaction + id: + $ref: '#/components/schemas/id' + paging_token: + type: string + successful: + type: boolean + hash: + type: string + ledger: + type: integer + format: int32 + created_at: + type: string + source_account: + $ref: '#/components/schemas/address' + account_muxed: + type: string + account_muxed_id: + type: string + source_account_sequence: + type: string + fee_account: + $ref: '#/components/schemas/address' + fee_account_muxed: + $ref: '#/components/schemas/address' + fee_account_muxed_id: + type: string + fee_charged: + type: string + max_fee: + type: string + operation_count: + type: integer + format: int32 + envelope_xdr: + type: string + result_xdr: + type: string + result_meta_xdr: + type: string + fee_meta_xdr: + type: string + memo_type: + type: string + signatures: + $ref: '#/components/schemas/signatures' + valid_after: + type: string + valid_before: + type: string + preconditions: + $ref: '#/components/schemas/TransactionPreconditions' + fee_bump_transaction: + $ref: '#/components/schemas/FeeBumpTransaction' + inner_transaction: + $ref: '#/components/schemas/InnerTransaction' + Payment: + type: object + properties: + _embedded: + type: object + properties: + records: + type: array + items: + type: object + properties: + _links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + transaction: + $ref: '#/components/schemas/link' + effects: + $ref: '#/components/schemas/link' + succeeds: + $ref: '#/components/schemas/link' + precedes: + $ref: '#/components/schemas/link' + required: + - self + - transaction + - effects + - succeeds + - precedes + id: + $ref: '#/components/schemas/id' + paging_token: + type: string + transaction_successful: + type: boolean + source_account: + $ref: '#/components/schemas/address' + type: + type: string + example: payment + type_i: + type: string + created_at: + type: string + transaction_hash: + type: string + asset_type: + type: string + asset_code: + enum: + - native + - credit_alphanum4 + - credit_alphanum12 + asset_issuer: + $ref: '#/components/schemas/address' + from: + $ref: '#/components/schemas/address' + to: + $ref: '#/components/schemas/address' + amount: + type: string + required: + - id + - paging_token + - transaction_successful + - source_account + - type + - type_i + - created_at + - transaction_hash + - asset_type + - from + - to + - amount + BaseAsset: + type: object + properties: + asset_type: + type: string + asset_code: + type: string + asset_issuer: + type: string + required: + - asset_type + Price: + type: object + properties: + 'n': + type: integer + format: int32 + d: + type: integer + format: int32 + Offer: + type: object + properties: + _embedded: + type: object + properties: + records: + type: array + items: + type: object + properties: + _links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + offer_maker: + $ref: '#/components/schemas/link' + required: + - self + - offer_maker + id: + $ref: '#/components/schemas/id' + paging_token: + type: string + seller: + $ref: '#/components/schemas/address' + selling: + $ref: '#/components/schemas/BaseAsset' + buying: + $ref: '#/components/schemas/BaseAsset' + amount: + type: string + price_r: + $ref: '#/components/schemas/Price' + price: + type: string + last_modified_ledger: + $ref: '#/components/schemas/last_modified_ledger' + last_modified_time: + type: string + sponser: + type: string + required: + - id + - paging_token + - seller + - selling + - buying + - amount + - price_r + - price + - last_modified_ledger + - last_modified_time + paging_token: + type: string + tradePrice: + type: object + properties: + 'n': + type: string + d: + type: string + Trade: + type: object + properties: + _embedded: + type: object + properties: + records: + type: array + items: + type: object + properties: + _links: + type: object + properties: + self: + $ref: '#/components/schemas/link' + base: + $ref: '#/components/schemas/link' + counter: + $ref: '#/components/schemas/link' + operation: + $ref: '#/components/schemas/link' + required: + - self + - base + - counter + - operation + id: + $ref: '#/components/schemas/id' + paging_token: + $ref: '#/components/schemas/paging_token' + ledger_close_time: + type: string + offer_id: + type: string + trade_type: + type: string + liquidity_pool_fee_bp: + type: number + format: uint32 + base_liquidity_pool_id: + type: string + base_offer_id: + type: string + base_account: + $ref: '#/components/schemas/address' + base_amount: + type: string + base_asset_type: + type: string + base_asset_code: + type: string + base_asset_issuer: + type: string + counter_liquidity_pool_id: + type: string + counter_offer_id: + type: string + counter_account: + $ref: '#/components/schemas/address' + counter_amount: + type: string + counter_asset_type: + type: string + counter_asset_code: + type: string + counter_asset_issuer: + $ref: '#/components/schemas/address' + base_is_seller: + type: boolean + price: + $ref: '#/components/schemas/tradePrice' + required: + - id + - paging_token + - ledger_close_time + - trade_type + - base_amount + - base_asset_type + - counter_amount + - counter_asset_type + - base_is_seller diff --git a/openapi/components/endpoints/accounts.yml b/openapi/components/endpoints/accounts.yml new file mode 100644 index 000000000..0a2d8b099 --- /dev/null +++ b/openapi/components/endpoints/accounts.yml @@ -0,0 +1,198 @@ +# Notes: +# September 22: +# - investigate Hal Links +# - consult for response descriptions +# - skipping operations endpoint for now +# - skipping payments endpoint for now +# - review number formats & time formats +# - review for omit empty in data structures (9/23 ) +# - clean up string patterns +# - review todos in payments schemas +# - Ask about baseAsset vs Asset. See google sheet +paths: + /accounts: + get: + tags: + - Accounts + summary: List all Accounts + description: "This endpoint lists accounts by one of four filters : signer, asset, liquidity pool or sponsor." + operationId: ListAllAccounts + parameters: + - $ref: '../parameters.yml#/components/parameters/SponsorParam' + - $ref: '../parameters.yml#/components/parameters/AssetParam' + - $ref: '../parameters.yml#/components/parameters/SignerParam' + - $ref: '../parameters.yml#/components/parameters/LiquidityPoolParam' + - $ref: '../parameters.yml#/components/parameters/CursorParam' + - $ref: '../parameters.yml#/components/parameters/OrderParam' + - $ref: '../parameters.yml#/components/parameters/LimitParam' + responses: + '200': + description: "Returns accounts based on provided filter: signer , asset, sponser or liquidity pool" + content: + application/json: + schema: + allOf: + - $ref: "../schemas/linksSchema.yml#/components/schemas/Links" + - $ref: "../schemas/accountSchema.yml#/components/schemas/Account" + /accounts/{account_id}: + get: + tags: + - Accounts + summary: Retrieve an Account + description: The single account endpoint provides information on a specific account. + The balances section in the response will also list all the trustlines this account has established, including trustlines that haven’t been authorized yet. + operationId: RetrieveAnAccount + parameters: + - $ref: '../parameters.yml#/components/parameters/AccountIDParam' + responses: + '200': + description: Returns details like balances, sponserships etc. about an account. + content: + application/json: + schema: + allOf: + - $ref: "../schemas/accountLinkSchema.yml#/components/schemas/AccountLink" + - $ref: "../schemas/accountSchema.yml#/components/schemas/Account" + /accounts/{account_id}/transactions: + get: + tags: + - Accounts + summary: Retrieve an Account's Transactions + description: "This endpoint represents successful transactions for a given account and can be used in streaming mode. Streaming mode allows you to listen for new transactions for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known transaction unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream transactions created since your request time." + operationId: GetTransactionsByAccountid + parameters: + - $ref: '../parameters.yml#/components/parameters/AccountIDParam' + - $ref: '../parameters.yml#/components/parameters/CursorParam' + - $ref: '../parameters.yml#/components/parameters/OrderParam' + - $ref: '../parameters.yml#/components/parameters/LimitParam' + - $ref: '../parameters.yml#/components/parameters/IncludeFailedParam' + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: "../schemas/linksSchema.yml#/components/schemas/Links" + - $ref: "../schemas/transactionSchema.yml#/components/schemas/Transaction" + + #TODO: 9/23 Investigate Operations object + /accounts/{account_id}/operations: + get: + tags: + - Accounts + summary: Retrieve an Account's Operations + description: This endpoint represents successful operations for a given account and can be used in streaming mode. Streaming mode allows you to listen for new operations for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known operation unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream operations created since your request time. + operationId: GetOperationsByAccountid + parameters: + - $ref: '../parameters.yml#/components/parameters/AccountIDParam' + - $ref: '../parameters.yml#/components/parameters/CursorParam' + - $ref: '../parameters.yml#/components/parameters/OrderParam' + - $ref: '../parameters.yml#/components/parameters/LimitParam' + - $ref: '../parameters.yml#/components/parameters/IncludeFailedParam' + - $ref: '../parameters.yml#/components/parameters/JoinParam' + responses: + '200': + description: OK + /accounts/{account_id}/payments: + get: + tags: + - Accounts + summary: Retrieve an Account's Payments + description: "This endpoint represents successful payments for a given account and can be used in streaming mode. Streaming mode allows you to listen for new payments for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known payment unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream payments created since your request time." + operationId: GetPaymentsbyAccountid + parameters: + - $ref: '../parameters.yml#/components/parameters/AccountIDParam' + - $ref: '../parameters.yml#/components/parameters/CursorParam' + - $ref: '../parameters.yml#/components/parameters/OrderParam' + - $ref: '../parameters.yml#/components/parameters/LimitParam' + - $ref: '../parameters.yml#/components/parameters/IncludeFailedParam' + - $ref: '../parameters.yml#/components/parameters/JoinParam' + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: "../schemas/linksSchema.yml#/components/schemas/Links" + - $ref: "../schemas/paymentSchema.yml#/components/schemas/Payment" + /accounts/{account_id}/effects: + get: + tags: + - Accounts + summary: Retrieve an Account's Effects + description: This endpoint returns the effects of a specific account and can be used in streaming mode. Streaming mode allows you to listen for new effects for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known effect unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream effects created since your request time. + operationId: GetEffectsbyAccountid + parameters: + - $ref: '../parameters.yml#/components/parameters/AccountIDParam' + - $ref: '../parameters.yml#/components/parameters/CursorParam' + - $ref: '../parameters.yml#/components/parameters/OrderParam' + - $ref: '../parameters.yml#/components/parameters/LimitParam' + responses: + '200': + description: OK + /accounts/{account_id}/offers: + get: + tags: + - Accounts + summary: Retrieve an Account's Offers + description: This endpoint represents all offers a given account has currently open and can be used in streaming mode. Streaming mode allows you to listen for new offers for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known offer unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream offers created since your request time. + operationId: GetOffersbyAccountid + parameters: + - $ref: '../parameters.yml#/components/parameters/AccountIDParam' + - $ref: '../parameters.yml#/components/parameters/CursorParam' + - $ref: '../parameters.yml#/components/parameters/OrderParam' + - $ref: '../parameters.yml#/components/parameters/LimitParam' + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: "../schemas/linksSchema.yml#/components/schemas/Links" + - $ref: "../schemas/offerSchema.yml#/components/schemas/Offer" + + /accounts/{account_id}/trades: + get: + tags: + - Accounts + summary: Retrieve an Account's Trades + description: This endpoint represents all trades for a given account and can be used in streaming mode. Streaming mode allows you to listen for trades for this account as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known trade unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream trades created since your request time. + operationId: GetTradesbyAccountid + parameters: + - $ref: '../parameters.yml#/components/parameters/AccountIDParam' + - $ref: '../parameters.yml#/components/parameters/CursorParam' + - $ref: '../parameters.yml#/components/parameters/OrderParam' + - $ref: '../parameters.yml#/components/parameters/LimitParam' + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: "../schemas/linksSchema.yml#/components/schemas/Links" + - $ref: "../schemas/tradeSchema.yml#/components/schemas/Trade" + + /accounts/{account_id}/data/{key}: + get: + tags: + - Accounts + summary: Retrieve an Account's Data + description: This endpoint represents a single data for a given account. + operationId: GetDatabyAccountid + parameters: + - $ref: '../parameters.yml#/components/parameters/AccountIDParam' + - $ref: '../parameters.yml#/components/parameters/DataParam' + responses: + '200': + description: blank + content: + application/json: + schema: + type: object + properties: + value: + type: string \ No newline at end of file diff --git a/openapi/components/endpoints/assets.yml b/openapi/components/endpoints/assets.yml new file mode 100644 index 000000000..840c9fba6 --- /dev/null +++ b/openapi/components/endpoints/assets.yml @@ -0,0 +1,26 @@ +paths: + /assets: + get: + tags: + - Assets + summary: List all Assets + description: This endpoint lists all assets. + operationId: ListAllAssets + parameters: + - $ref: '../parameters.yml#/components/parameters/AssetCodeParam' + - $ref: '../parameters.yml#/components/parameters/AssetIssuerParam' + - $ref: '../parameters.yml#/components/parameters/CursorParam' + - $ref: '../parameters.yml#/components/parameters/OrderParam' + - $ref: '../parameters.yml#/components/parameters/LimitParam' + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: "../schemas/linksSchema.yml#/components/schemas/Links" + - $ref: "../schemas/assetSchema.yml#/components/schemas/Asset" + + + diff --git a/openapi/components/endpoints/ledgers.yml b/openapi/components/endpoints/ledgers.yml new file mode 100644 index 000000000..e69de29bb diff --git a/openapi/components/endpoints/offers.yml b/openapi/components/endpoints/offers.yml new file mode 100644 index 000000000..1a6e4d47f --- /dev/null +++ b/openapi/components/endpoints/offers.yml @@ -0,0 +1,77 @@ +paths: + /offers: + get: + tags: + - Offers + summary: List All Offers + description: "This endpoint lists all currently open offers and can be used in streaming mode. Streaming mode allows you to listen for new offers as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known offer unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream offers created since your request time. When filtering by buying or selling arguments, you must use a combination of selling_asset_type, selling_asset_issuer, and selling_asset_code for the selling asset, or a combination of buying_asset_type, buying_asset_issuer, and buying_asset_code for the buying asset." + operationId: GetAllOffers + parameters: + - $ref: '../parameters.yml#/components/parameters/SponsorParam' + - $ref: '../parameters.yml#/components/parameters/SellerParam' + - $ref: '../parameters.yml#/components/parameters/SellingAssetTypeParam' + - $ref: '../parameters.yml#/components/parameters/SellingAssetIssuerParam' + - $ref: '../parameters.yml#/components/parameters/SellingAssetCodeParam' + - $ref: '../parameters.yml#/components/parameters/BuyingAssetTypeParam' + - $ref: '../parameters.yml#/components/parameters/BuyingAssetIssuerParam' + - $ref: '../parameters.yml#/components/parameters/BuyingAssetCodeParam' + - $ref: '../parameters.yml#/components/parameters/CursorParam' + - $ref: '../parameters.yml#/components/parameters/OrderParam' + - $ref: '../parameters.yml#/components/parameters/LimitParam' + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: "../schemas/linksSchema.yml#/components/schemas/Links" + - $ref: "../schemas/offerSchema.yml#/components/schemas/Offer" + /offers/{offer_id}: + get: + tags: + - Offers + summary: Retrieve an Offer + description: The single offer endpoint provides information on a specific offer. + operationId: GetOfferbyOfferid + parameters: + - $ref: '../parameters.yml#/components/parameters/OfferIDParam' + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: "../schemas/linksSchema.yml#/components/schemas/Links" + - $ref: "../schemas/offerSchema.yml#/components/schemas/Offer" + /offers/{offer_id}/trades: + get: + tags: + - Offers + summary: Retrieve an Offer's Trades + description: This endpoint represents all trades for a given offer and can be used in streaming mode. Streaming mode allows you to listen for trades for this offer as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known trade unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream trades created since your request time. + operationId: GetTradesbyOfferid + parameters: + - $ref: '../parameters.yml#/components/parameters/OfferIDParam' + - $ref: '../parameters.yml#/components/parameters/CursorParam' + - $ref: '../parameters.yml#/components/parameters/OrderParam' + - $ref: '../parameters.yml#/components/parameters/LimitParam' + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: "../schemas/linksSchema.yml#/components/schemas/Links" + - $ref: "../schemas/tradeSchema.yml#/components/schemas/Trade" + + + + + + + + + diff --git a/openapi/components/endpoints/trades.yml b/openapi/components/endpoints/trades.yml new file mode 100644 index 000000000..d6114b616 --- /dev/null +++ b/openapi/components/endpoints/trades.yml @@ -0,0 +1,32 @@ +paths: + /trades: + get: + tags: + - Trades + summary: List All Trades + description: "This endpoint lists all trades and can be used in streaming mode. Streaming mode allows you to listen for new trades as they are added to the Stellar ledger. If called in streaming mode, Horizon will start at the earliest known trade unless a cursor is set, in which case it will start from that cursor. By setting the cursor value to now, you can stream trades created since your request time. When filtering for a specific orderbook, you must use use all six of these arguments: base_asset_type, base_asset_issuer, base_asset_code, counter_asset_type, counter_asset_issuer, and counter_asset_code. If the base or counter asset is XLM, you only need to indicate the asset type as native and do not need to designate the code or the issuer." + operationId: GetAllTrades + parameters: + - $ref: '../parameters.yml#/components/parameters/OfferIdParam' + - $ref: '../parameters.yml#/components/parameters/BaseAssetTypeParam' + - $ref: '../parameters.yml#/components/parameters/BaseAssetIssuerParam' + - $ref: '../parameters.yml#/components/parameters/BaseAssetCodeParam' + - $ref: '../parameters.yml#/components/parameters/CounterAssetTypeParam' + - $ref: '../parameters.yml#/components/parameters/CounterAssetIssuerParam' + - $ref: '../parameters.yml#/components/parameters/CounterAssetCodeParam' + - $ref: '../parameters.yml#/components/parameters/TradeTypeParam' + - $ref: '../parameters.yml#/components/parameters/CursorParam' + - $ref: '../parameters.yml#/components/parameters/OrderParam' + - $ref: '../parameters.yml#/components/parameters/LimitParam' + + responses: + '200': + description: blank + content: + application/json: + schema: + allOf: + - $ref: "../schemas/linksSchema.yml#/components/schemas/Links" + - $ref: "../schemas/tradeSchema.yml#/components/schemas/Trade" + + \ No newline at end of file diff --git a/openapi/components/instance_variables.yml b/openapi/components/instance_variables.yml new file mode 100644 index 000000000..a80838e3d --- /dev/null +++ b/openapi/components/instance_variables.yml @@ -0,0 +1,58 @@ +components: + schemas: + id: + type: string + address: + type: string + pattern: "G[A-Z0-9]{55}" + sequence: + type: string + pattern: "[0-9]+" + subentry_count: + type: integer + format: int32 + sequence_ledger: + type: integer + format: uint32 + last_modified_ledger: + type: integer + format: uint32 + flags: + type: object + properties: + auth_required: + type: boolean + auth_revocable: + type: boolean + auth_immutable: + type: boolean + auth_clawback_enabled: + type: boolean + thresholds: + type: object + properties: + low_threshold: + type: integer + med_threshold: + type: integer + high_threshold: + type: integer + hash: + type: string + signatures: + type: array + items: + type: string + pattern: "G[A-Z0-9]{55}" + link: + type: object + properties: + href: + type: string + format: link + templated: + type: boolean + required: + ["href"] + paging_token: + type: string \ No newline at end of file diff --git a/openapi/components/parameters.yml b/openapi/components/parameters.yml new file mode 100644 index 000000000..6ea10d16e --- /dev/null +++ b/openapi/components/parameters.yml @@ -0,0 +1,219 @@ +components: + parameters: + AccountIDParam: + name: account_id + in: path + required: true + description: This account’s public key encoded in a base32 string representation. + schema: + type: string + example: GDMQQNJM4UL7QIA66P7R2PZHMQINWZBM77BEBMHLFXD5JEUAHGJ7R4JZ + AssetCodeParam: + name: asset_code + in: query + required: false + description: The code of the asset you would like to filter by. + AssetIssuerParam: + name: asset_issuer + in: query + required: false + description: The Stellar address of the issuer for the asset you would like to filter by. + AssetParam: + name: asset + in: query + required: false + description: An issued asset represented as “Code:IssuerAccountID”. Every account in the response will have a trustline for the given asset. + BaseAssetCodeParam: + name: base_asset_code + in: query + required: false + description: The code for the base asset. + schema: + type: string + example: USD + BaseAssetIssuerParam: + name: base_asset_issuer + in: query + required: false + description: The Stellar address of the base asset’s issuer. + schema: + type: string + example: GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX + BaseAssetTypeParam: + name: base_asset_type + in: query + required: false + description: The type for the base asset. Either native, credit_alphanum4, or credit_alphanum12. + schema: + type: string + enum: + - native + - credit_alphanum4 + - credit_alphanum12 + BuyingAssetCodeParam: + name: buying_asset_code + in: query + required: false + description: The code for the buying asset. + BuyingAssetIssuerParam: + name: buying_asset_issuer + in: query + required: false + description: The Stellar address of the buying asset’s issuer. + BuyingAssetTypeParam: + name: buying_asset_type + in: query + required: false + description: The type for the buying asset. Either native, credit_alphanum4, or credit_alphanum12. + schema: + type: string + enum: + - native + - credit_alphanum4 + - credit_alphanum12 + CounterAssetCodeParam: + name: counter_asset_code + in: query + required: false + description: The code for the counter asset. + CounterAssetIssuerParam: + name: counter_asset_issuer + in: query + required: false + description: The Stellar address of the counter asset’s issuer. + schema: + type: string + example: GDUKMGUGDZQK6YHYA5Z6AY2G4XDSZPSZ3SW5UN3ARVMO6QSRDWP5YLEX + CounterAssetTypeParam: + name: counter_asset_type + in: query + required: false + description: The type for the counter asset. Either native, credit_alphanum4, or credit_alphanum12. + schema: + type: string + enum: + - native + - credit_alphanum4 + - credit_alphanum12 + CursorParam: + name: cursor + in: query + required: false + description: A number that points to a specific location in a collection of responses and is pulled from the paging_token value of a record. + schema: + type: integer + example: 6606617478959105 + DataParam: + name: key + in: path + required: true + description: The key name for this data. + schema: + type: string + example: config.memo_required + IncludeFailedParam: + name: includefailed + in: query + required: false + description: Set to true to include failed operations in results. Options include true and false. + schema: + type: boolean + enum: + - true + - false + JoinParam: + name: join + in: query + required: false + description: Set to transactions to include the transactions which created each of the operations in the response. + LimitParam: + name: limit + in: query + required: false + description: The maximum number of records returned. The limit can range from 1 to 200 - an upper limit that is hardcoded in Horizon for performance reasons. If this argument isn’t designated, it defaults to 10. + schema: + type: integer + example: 10 + LiquidityPoolParam: + name: liqudity_pool + in: query + required: false + description: With this parameter, the results will include only accounts which have trustlines to the specified liquidity pool. + OfferIdParam: + name: offer_id + in: query + required: false + description: The offer ID. Used to filter for trades originating from a specific offer. + OfferIDParam: + name: offer_id + in: path + required: true + description: A unique identifier for this offer. + OrderParam: + name: order + in: query + required: false + description: A designation of the order in which records should appear. Options include asc (ascending) or desc (descending). If this argument isn’t set, it defaults to asc. + schema: + type: string + enum: + - asc + - desc + SellerParam: + name: seller + in: query + required: false + description: The account ID of the offer creator. + SellingAssetCodeParam: + name: selling_asset_code + in: query + required: false + description: The code for the selling asset. + SellingAssetIssuerParam: + name: selling_asset_issuer + in: query + required: false + description: The Stellar address of the selling asset’s issuer. + SellingAssetTypeParam: + name: selling_asset_type + in: query + required: false + description: The type for the selling asset. Either native, credit_alphanum4, or credit_alphanum12. + schema: + type: string + enum: + - native + - credit_alphanum4 + - credit_alphanum12 + SignerParam: + name: signer + in: query + required: false + description: Account ID of the signer. Every account in the response will have the given account ID as a signer. + schema: + type: string + example: GDMQQNJM4UL7QIA66P7R2PZHMQINWZBM77BEBMHLFXD5JEUAHGJ7R4JZ + SponsorParam: + name: sponser + in: query + required: false + description: Account ID of the sponsor. Every account in the response will either be sponsored by the given account ID or have a subentry (trustline, offer, or data entry) which is sponsored by the given account ID. + schema: + type: string + example: GDMQQNJM4UL7QIA66P7R2PZHMQINWZBM77BEBMHLFXD5JEUAHGJ7R4JZ + TradeTypeParam: + name: trade_type + in: query + required: false + description: Can be set to all, orderbook, or liquidity_pools to filter only trades executed across a given mechanism. + schema: + type: string + enum: + - all + - orderbook + - liquidity_pools + + + + + \ No newline at end of file diff --git a/openapi/components/schemas/accountLinkSchema.yml b/openapi/components/schemas/accountLinkSchema.yml new file mode 100644 index 000000000..bd9580ea2 --- /dev/null +++ b/openapi/components/schemas/accountLinkSchema.yml @@ -0,0 +1,42 @@ +components: + schemas: + AccountLink: + type: object + properties: + _embedded: + type: object + properties: + records: + type: array + items: + type: object + properties: + _links: + type: object + properties: + self: + $ref: '../instance_variables.yml#/components/schemas/link' + transactions: + $ref: '../instance_variables.yml#/components/schemas/link' + operations: + $ref: '../instance_variables.yml#/components/schemas/link' + payments: + $ref: '../instance_variables.yml#/components/schemas/link' + effects: + $ref: '../instance_variables.yml#/components/schemas/link' + offers: + $ref: '../instance_variables.yml#/components/schemas/link' + trades: + $ref: '../instance_variables.yml#/components/schemas/link' + data: + $ref: '../instance_variables.yml#/components/schemas/link' + $ref: '../schemas/accountSchema.yml#/components/schemas/Account' + required: + - self + - transactions + - operations + - payments + - effects + - offers + - trades + - data \ No newline at end of file diff --git a/openapi/components/schemas/accountSchema.yml b/openapi/components/schemas/accountSchema.yml new file mode 100644 index 000000000..9fa09b172 --- /dev/null +++ b/openapi/components/schemas/accountSchema.yml @@ -0,0 +1,123 @@ +components: + schemas: + Account: + type: object + properties: + _embedded: + type: object + properties: + records: + type: array + items: + type: object + properties: + _links: + type: object + properties: + self: + $ref: '../instance_variables.yml#/components/schemas/link' + transactions: + $ref: '../instance_variables.yml#/components/schemas/link' + operations: + $ref: '../instance_variables.yml#/components/schemas/link' + payments: + $ref: '../instance_variables.yml#/components/schemas/link' + effects: + $ref: '../instance_variables.yml#/components/schemas/link' + offers: + $ref: '../instance_variables.yml#/components/schemas/link' + trades: + $ref: '../instance_variables.yml#/components/schemas/link' + data: + $ref: '../instance_variables.yml#/components/schemas/link' + required: + - self + - transactions + - operations + - payments + - effects + - offers + - trades + - data + id: + $ref: '../instance_variables.yml#/components/schemas/id' + account_id: + $ref: '../instance_variables.yml#/components/schemas/address' + sequence: + $ref: '../instance_variables.yml#/components/schemas/sequence' + sequence_ledger: + $ref: '../instance_variables.yml#/components/schemas/sequence_ledger' + sequence_time: + type: string + subentry_count: + $ref: '../instance_variables.yml#/components/schemas/subentry_count' + inflation_destination: + $ref: '../instance_variables.yml#/components/schemas/address' + home_domain: + type: string + last_modified_ledger: + $ref: '../instance_variables.yml#/components/schemas/last_modified_ledger' + last_modified_time: + type: string + thresholds: + $ref: '../instance_variables.yml#/components/schemas/thresholds' + flags: + $ref: '../instance_variables.yml#/components/schemas/flags' + balances: + type: array + items: + anyOf: + - $ref: '../schemas/balanceSchema.yml#/components/schemas/BalanceLineNative' + - $ref: '../schemas/balanceSchema.yml#/components/schemas/BalanceLineAsset' + - $ref: '../schemas/balanceSchema.yml#/components/schemas/BalanceLineLiquidityPool' + signers: + type: array + items: + $ref: '#/components/schemas/signers' + data: + type: object + num_sponsoring: + type: integer + num_sponsered: + type: integer + sponser: + $ref: '../instance_variables.yml#/components/schemas/address' + paging_token: + type: string + required: + - id + - account_id + - sequence + - subentry_count + - last_modified_ledger + - last_modified_time + - thresholds + - flags + - balances + - signers + - data + - num_sponsoring + - num_sponsered + - paging_token + + signers: + type: object + properties: + key: + $ref: '../instance_variables.yml#/components/schemas/address' + weight: + type: integer + format: int32 + type: + type: string + enum: + - ed25519_public_key + - sha256_hash + - preauth_tx + sponser: + $ref: '../instance_variables.yml#/components/schemas/address' + required: + - key + - weight + - type + diff --git a/openapi/components/schemas/assetSchema.yml b/openapi/components/schemas/assetSchema.yml new file mode 100644 index 000000000..7a5c51b64 --- /dev/null +++ b/openapi/components/schemas/assetSchema.yml @@ -0,0 +1,59 @@ +components: + schemas: + Asset: + type: object + properties: + _embedded: + type: object + properties: + records: + type: array + items: + type: object + properties: + _links: + type: object + properties: + toml: + $ref: '../instance_variables.yml#/components/schemas/link' + asset_type: + type: string + asset_issuer: + $ref: '../instance_variables.yml#/components/schemas/address' + paging_token: + type: string + accounts: + type: object + properties: + authorized: + type: integer + authorized_to_maintain_liabilities: + type: integer + unathorized: + type: integer + num_claimable_balances: + type: integer + balances: + type: object + properties: + authorized: + type: string + authorized_to_maintain_liabilities: + type: string + unathorized: + type: string + claimable_balances_amount: + type: string + amount: + type: string + num_accounts: + type: integer + flags: + type: object + properties: + auth_required: + type: boolean + auth_revocable: + type: boolean + auth_immutable: + type: boolean \ No newline at end of file diff --git a/openapi/components/schemas/balanceSchema.yml b/openapi/components/schemas/balanceSchema.yml new file mode 100644 index 000000000..a5de33d73 --- /dev/null +++ b/openapi/components/schemas/balanceSchema.yml @@ -0,0 +1,124 @@ +components: + schemas: + BalanceLineNative: + type: object + properties: + balance: + $ref: '#/components/schemas/currency' + liquidity_pool_id: + type: string + limit: + $ref: '#/components/schemas/currency' + buying_liabilites: + $ref: '#/components/schemas/currency' + selling_liabilites: + $ref: '#/components/schemas/currency' + sponser: + type: string + last_modified_ledger: + $ref: '#/components/schemas/last_modified_ledger' + is_authorized: + type: boolean + is_authorized_to_maintain_liabilites: + type: boolean + is_clawback_enabled: + type: boolean + asset_type: + type: string + enum: + - native + required: + - balance + - limit + - asset_type + - buying_liabilites + - selling_liabilites + - last_modified_ledger + - is_authorized + - is_authorized_to_maintain_liabilites + - is_clawback_enabled + BalanceLineAsset: + type: object + properties: + balance: + $ref: '#/components/schemas/currency' + limit: + $ref: '#/components/schemas/currency' + buying_liabilites: + $ref: '#/components/schemas/currency' + selling_liabilites: + $ref: '#/components/schemas/currency' + sponser: + $ref: '#/components/schemas/address' + last_modified_ledger: + $ref: '#/components/schemas/last_modified_ledger' + is_authorized: + type: boolean + is_authorized_to_maintain_liabilites: + type: boolean + is_clawback_enabled: + type: boolean + asset_type: + type: string + enum: + - credit_alphanum4 + - credit_alphanum12 + asset_code: + type: string + asset_issuer: + $ref: '#/components/schemas/address' + required: + - balance + - limit + - asset_type + - asset_code + - asset_issuer + - buying_liabilites + - selling_liabilites + - last_modified_ledger + - is_authorized + - is_authorized_to_maintain_liabilites + - is_clawback_enabled + BalanceLineLiquidityPool: + type: object + properties: + liquidity_pool_id: + type: string + asset_type: + type: string + enum: + - liquidity_pool_shares + balance: + $ref: '#/components/schemas/currency' + limit: + $ref: '#/components/schemas/currency' + last_modified_ledger: + $ref: '#/components/schemas/last_modified_ledger' + sponser: + $ref: '#/components/schemas/address' + is_authorized: + type: boolean + is_authorized_to_maintain_liabilites: + type: boolean + is_clawback_enabled: + type: boolean + required: + - liquidity_pool_id + - balance + - limit + - asset_type + - last_modified_ledger + - is_authorized + - is_authorized_to_maintain_liabilites + - is_clawback_enabled + currency: + type: string + pattern: '[0-9]+\.[0-9]{7}' + address: + type: string + pattern: "G[A-Z0-9]{55}" + last_modified_ledger: + type: integer + format: uint32 + + \ No newline at end of file diff --git a/openapi/components/schemas/baseAssetSchema.yml b/openapi/components/schemas/baseAssetSchema.yml new file mode 100644 index 000000000..815ed25d9 --- /dev/null +++ b/openapi/components/schemas/baseAssetSchema.yml @@ -0,0 +1,22 @@ +components: + schemas: + BaseAsset: + type: object + properties: + asset_type: + type: string + asset_code: + type: string + asset_issuer: + type: string + required: + - asset_type + Price: + type: object + properties: + n: + type: integer + format: int32 + d: + type: integer + format: int32 \ No newline at end of file diff --git a/openapi/components/schemas/ledgerSchema.yml b/openapi/components/schemas/ledgerSchema.yml new file mode 100644 index 000000000..919831e7e --- /dev/null +++ b/openapi/components/schemas/ledgerSchema.yml @@ -0,0 +1,94 @@ +components: + schemas: + Ledger: + type: object + properties: + _embedded: + type: object + properties: + records: + type: array + items: + type: object + properties: + _links: + type: object + properties: + self: + $ref: '../instance_variables.yml#/components/schemas/link' + transactions: + $ref: '../instance_variables.yml#/components/schemas/link' + operations: + $ref: '../instance_variables.yml#/components/schemas/link' + payments: + $ref: '../instance_variables.yml#/components/schemas/link' + effects: + $ref: '../instance_variables.yml#/components/schemas/link' + id: + $ref: '../instance_variables.yml#/components/schemas/id' + paging_token: + $ref: '../instance_variables.yml#/components/schemas/paging_token' + hash: + $ref: '../instance_variables.yml#/components/schemas/hash' + pre_hash: + $ref: '../instance_variables.yml#/components/schemas/hash' + sequence: + type: integer + format: int32 + successful_transaction_count: + type: integer + format: int32 + failed_transaction_count: + type: integer + format: int32 + operation_count: + type: integer + format: int32 + tx_set_operation_count: + type: integer + format: int32 + closed_at: + type: string + total_coins: + type: string + fee_pool: + type: string + base_fee_in_stroops: + type: integer + format: int32 + base_reserve_in_stroops: + type: integer + format: int32 + max_tx_set_size: + type: integer + format: int32 + protocol_version: + type: integer + format: int32 + header_xdr: + type: string + required: + - id + - paging_token + - hash + - sequence + - successful_transaction_count + - failed_transaction_count + - operation_count + - tx_set_operation_count + - closed_at + - total_coins + - fee_pool + - base_fee_in_stroops + - base_reserve_in_stroops + - max_tx_set_size + - protocol_version + - header_xdr + + + + + + + + \ No newline at end of file diff --git a/openapi/components/schemas/linksSchema.yml b/openapi/components/schemas/linksSchema.yml new file mode 100644 index 000000000..8da427883 --- /dev/null +++ b/openapi/components/schemas/linksSchema.yml @@ -0,0 +1,18 @@ +components: + schemas: + Links: + type: object + properties: + _links: + type: object + properties: + self: + $ref: '../instance_variables.yml#/components/schemas/link' + next: + $ref: '../instance_variables.yml#/components/schemas/link' + prev: + $ref: '../instance_variables.yml#/components/schemas/link' + required: + - self + - next + - prev \ No newline at end of file diff --git a/openapi/components/schemas/offerSchema.yml b/openapi/components/schemas/offerSchema.yml new file mode 100644 index 000000000..278a20d29 --- /dev/null +++ b/openapi/components/schemas/offerSchema.yml @@ -0,0 +1,57 @@ +components: + schemas: + Offer: + type: object + properties: + _embedded: + type: object + properties: + records: + type: array + items: + type: object + properties: + _links: + type: object + properties: + self: + $ref: '../instance_variables.yml#/components/schemas/link' + offer_maker: + $ref: '../instance_variables.yml#/components/schemas/link' + required: + - self + - offer_maker + id: + $ref: '../instance_variables.yml#/components/schemas/id' + paging_token: + type: string + seller: + $ref: '../instance_variables.yml#/components/schemas/address' + selling: + $ref: 'baseassetSchema.yml#/components/schemas/BaseAsset' + buying: + $ref: 'baseassetSchema.yml#/components/schemas/BaseAsset' + amount: + type: string + price_r: + $ref: 'baseassetSchema.yml#/components/schemas/Price' + price: + type: string + last_modified_ledger: + $ref: '../instance_variables.yml#/components/schemas/last_modified_ledger' + last_modified_time: + type: string + sponser: + type: string + required: + - id + - paging_token + - seller + - selling + - buying + - amount + - price_r + - price + - last_modified_ledger + - last_modified_time + \ No newline at end of file diff --git a/openapi/components/schemas/paymentSchema.yml b/openapi/components/schemas/paymentSchema.yml new file mode 100644 index 000000000..dc1919270 --- /dev/null +++ b/openapi/components/schemas/paymentSchema.yml @@ -0,0 +1,84 @@ +# TODO: Review Todo's written in here +# - 3 operations: Create account, account merge, payment +# - Determine if this needs seperate examples for the three operations +components: + schemas: + Payment: + type: object + properties: + _embedded: + type: object + properties: + records: + type: array + items: + type: object + properties: + _links: + type: object + properties: + self: + $ref: '../instance_variables.yml#/components/schemas/link' + transaction: + $ref: '../instance_variables.yml#/components/schemas/link' + effects: + $ref: '../instance_variables.yml#/components/schemas/link' + succeeds: + $ref: '../instance_variables.yml#/components/schemas/link' + precedes: + $ref: '../instance_variables.yml#/components/schemas/link' + required: + - self + - transaction + - effects + - succeeds + - precedes + id: + $ref: '../instance_variables.yml#/components/schemas/id' + paging_token: + type: string + transaction_successful: + type: boolean + source_account: + $ref: '../instance_variables.yml#/components/schemas/address' + type: + type: string + example: payment + #TODO: 9/22 What is this? + type_i: + type: string + created_at: + type: string + #TODO: Ask if the transaction hashs have a pattern + transaction_hash: + type: string + # Ask about enum for asset type + asset_type: + type: string + asset_code: + enum: + - native + - credit_alphanum4 + - credit_alphanum12 + asset_issuer: + $ref: '../instance_variables.yml#/components/schemas/address' + #TODO: What is the data type for starting balance? + from: + $ref: '../instance_variables.yml#/components/schemas/address' + to: + $ref: '../instance_variables.yml#/components/schemas/address' + amount: + type: string + required: + - id + - paging_token + - transaction_successful + - source_account + - type + - type_i + - created_at + - transaction_hash + - asset_type + - from + - to + - amount \ No newline at end of file diff --git a/openapi/components/schemas/tradeSchema.yml b/openapi/components/schemas/tradeSchema.yml new file mode 100644 index 000000000..53b13dd7f --- /dev/null +++ b/openapi/components/schemas/tradeSchema.yml @@ -0,0 +1,93 @@ +components: + schemas: + Trade: + type: object + properties: + _embedded: + type: object + properties: + records: + type: array + items: + type: object + properties: + _links: + type: object + properties: + self: + $ref: '../instance_variables.yml#/components/schemas/link' + base: + $ref: '../instance_variables.yml#/components/schemas/link' + counter: + $ref: '../instance_variables.yml#/components/schemas/link' + operation: + $ref: '../instance_variables.yml#/components/schemas/link' + required: + - self + - base + - counter + - operation + id: + $ref: '../instance_variables.yml#/components/schemas/id' + paging_token: + $ref: '../instance_variables.yml#/components/schemas/paging_token' + ledger_close_time: + type: string + offer_id: + type: string + trade_type: + type: string + liquidity_pool_fee_bp: + type: number + format: uint32 + base_liquidity_pool_id: + type: string + base_offer_id: + type: string + base_account: + $ref: '../instance_variables.yml#/components/schemas/address' + base_amount: + type: string + base_asset_type: + type: string + base_asset_code: + type: string + base_asset_issuer: + type: string + counter_liquidity_pool_id: + type: string + counter_offer_id: + type: string + counter_account: + $ref: '../instance_variables.yml#/components/schemas/address' + counter_amount: + type: string + counter_asset_type: + type: string + counter_asset_code: + type: string + counter_asset_issuer: + $ref: '../instance_variables.yml#/components/schemas/address' + base_is_seller: + type: boolean + price: + $ref: '#/components/schemas/tradePrice' + + required: + - id + - paging_token + - ledger_close_time + - trade_type + - base_amount + - base_asset_type + - counter_amount + - counter_asset_type + - base_is_seller + tradePrice: + type: object + properties: + n: + type: string + d: + type: string + \ No newline at end of file diff --git a/openapi/components/schemas/transactionLinkSchema.yml b/openapi/components/schemas/transactionLinkSchema.yml new file mode 100644 index 000000000..003c5438c --- /dev/null +++ b/openapi/components/schemas/transactionLinkSchema.yml @@ -0,0 +1,31 @@ +# Sept 19: I have not determined how the links schema works in OpenApo +# yet, therefore I am not sure the links will stay in this format. +components: + schemas: + TransactionLink: + properties: + self: + $ref: '../instance_variables.yml#/components/schemas/link' + account: + $ref: '../instance_variables.yml#/components/schemas/link' + ledger: + $ref: '../instance_variables.yml#/components/schemas/link' + operations: + $ref: '../instance_variables.yml#/components/schemas/link' + effects: + $ref: '../instance_variables.yml#/components/schemas/link' + precedes: + $ref: '../instance_variables.yml#/components/schemas/link' + succeeds: + $ref: '../instance_variables.yml#/components/schemas/link' + transaction: + $ref: '../instance_variables.yml#/components/schemas/link' + required: + - self + - account + - ledger + - operations + - effects + - precedes + - succeeds + - transaction diff --git a/openapi/components/schemas/transactionSchema.yml b/openapi/components/schemas/transactionSchema.yml new file mode 100644 index 000000000..bca357d9b --- /dev/null +++ b/openapi/components/schemas/transactionSchema.yml @@ -0,0 +1,155 @@ +components: + schemas: + Transaction: + type: object + properties: + _embedded: + type: object + properties: + records: + type: array + items: + type: object + properties: + memo: + type: string + memo_bytes: + type: string + _links: + type: object + properties: + self: + $ref: '../instance_variables.yml#/components/schemas/link' + account: + $ref: '../instance_variables.yml#/components/schemas/link' + ledger: + $ref: '../instance_variables.yml#/components/schemas/link' + operations: + $ref: '../instance_variables.yml#/components/schemas/link' + effects: + $ref: '../instance_variables.yml#/components/schemas/link' + precedes: + $ref: '../instance_variables.yml#/components/schemas/link' + succeeds: + $ref: '../instance_variables.yml#/components/schemas/link' + transaction: + $ref: '../instance_variables.yml#/components/schemas/link' + required: + - self + - account + - ledger + - operations + - effects + - precedes + - succeeds + - transaction + + id: + $ref: '../instance_variables.yml#/components/schemas/id' + paging_token: + type: string + successful: + type: boolean + hash: + type: string + ledger: + type: integer + format: int32 + created_at: + type: string + source_account: + $ref: '../instance_variables.yml#/components/schemas/address' + account_muxed: + type: string + account_muxed_id: + type: string + source_account_sequence: + type: string + fee_account: + $ref: '../instance_variables.yml#/components/schemas/address' + fee_account_muxed: + $ref: '../instance_variables.yml#/components/schemas/address' + fee_account_muxed_id: + type: string + fee_charged: + type: string + max_fee: + type: string + operation_count: + type: integer + format: int32 + envelope_xdr: + type: string + result_xdr: + type: string + result_meta_xdr: + type: string + fee_meta_xdr: + type: string + memo_type: + type: string + signatures: + $ref: '../instance_variables.yml#/components/schemas/signatures' + valid_after: + type: string + valid_before: + type: string + preconditions: + $ref: '#/components/schemas/TransactionPreconditions' + fee_bump_transaction: + $ref: '#/components/schemas/FeeBumpTransaction' + inner_transaction: + $ref: '#/components/schemas/InnerTransaction' + + TransactionPreconditionsTimebounds: + type: object + properties: + min_time: + type: string + max_time: + type: string + + TransactionPreconditionsLedgerbounds: + type: object + properties: + min_ledger: + type: string + max_ledger: + type: string + + TransactionPreconditions: + type: object + properties: + timebounds: + $ref: '#/components/schemas/TransactionPreconditionsTimebounds' + ledgerbounds: + $ref: '#/components/schemas/TransactionPreconditionsLedgerbounds' + min_account_sequence: + type: string + min_account_sequence_age: + type: string + min_account_sequence_ledger_gap: + type: integer + format: uint32 + extra_signers: + type: array + items: + type: string + + FeeBumpTransaction: + type: object + properties: + hash: + $ref: '../instance_variables.yml#/components/schemas/hash' + signatures: + $ref: '../instance_variables.yml#/components/schemas/signatures' + + InnerTransaction: + type: object + properties: + hash: + $ref: '../instance_variables.yml#/components/schemas/hash' + signatures: + $ref: '../instance_variables.yml#/components/schemas/signatures' + max_fee: + type: string \ No newline at end of file diff --git a/openapi/main.yml b/openapi/main.yml index 2d553957b..d61dabae5 100644 --- a/openapi/main.yml +++ b/openapi/main.yml @@ -2,17 +2,51 @@ openapi: 3.0.3 info: title: Horizon version: 0.0.1 + +servers: + - url: https://horizon.stellar.org + description: The main network + - url: https://horizon-testnet.stellar.org + description: The test network tags: - - name: account + - name: Accounts description: Users interact with the Stellar network through accounts. Everything else in the ledger—assets, offers, trustlines, etc. are owned by accounts, and accounts must authorize all changes to the ledger through signed transactions. - - name: assets + - name: Assets description: Assets are representations of value issued on the Stellar network. An asset consists of a type, code, and issuer. + - name: Ledgers + description: Each ledger stores the state of the network at a point in time and contains all the changes - transactions, operations, effects, etc. - to that state. + - name: Offers + description: Offers are statements about how much of an asset an account wants to buy or sell. + - name: Trades + description: When an offer is fully or partially fulfilled, a trade happens. Trades can also be caused by successful path payments, because path payments involve fulfilling offers. A trade occurs between two parties—base and counter. Which is which is either arbitrary or determined by the calling query. paths: + /accounts: + $ref: '../openapi/components/endpoints/accounts.yml#/paths/~1accounts' /accounts/{account_id}: - $ref: 'account.yml#/paths/~1accounts~1{account_id}' + $ref: '../openapi/components/endpoints/accounts.yml#/paths/~1accounts~1{account_id}' + /accounts/{account_id}/transactions: + $ref : '../openapi/components/endpoints/accounts.yml#/paths/~1accounts~1{account_id}~1transactions' /accounts/{account_id}/operations: - $ref : 'account.yml#/paths/~1accounts~1{account_id}~1operations' - - - + $ref : '../openapi/components/endpoints/accounts.yml#/paths/~1accounts~1{account_id}~1operations' + /accounts/{account_id}/payments: + $ref : '../openapi/components/endpoints/accounts.yml#/paths/~1accounts~1{account_id}~1payments' + /accounts/{account_id}/effects: + $ref : '../openapi/components/endpoints/accounts.yml#/paths/~1accounts~1{account_id}~1effects' + /accounts/{account_id}/offers: + $ref : '../openapi/components/endpoints/accounts.yml#/paths/~1accounts~1{account_id}~1offers' + /accounts/{account_id}/trades: + $ref : '../openapi/components/endpoints/accounts.yml#/paths/~1accounts~1{account_id}~1trades' + /accounts/{account_id}/data/{key}: + $ref : '../openapi/components/endpoints/accounts.yml#/paths/~1accounts~1{account_id}~1data~1{key}' + /assets: + $ref : '../openapi/components/endpoints/assets.yml#/paths/~1assets' + /offers: + $ref : '../openapi/components/endpoints/offers.yml#/paths/~1offers' + /offers/{offer_id}: + $ref : '../openapi/components/endpoints/offers.yml#/paths/~1offers~1{offer_id}' + /offers/{offer_id}/trades: + $ref : '../openapi/components/endpoints/offers.yml#/paths/~1offers~1{offer_id}~1trades' + /trades: + $ref : '../openapi/components/endpoints/trades.yml#/paths/~1trades' + \ No newline at end of file diff --git a/openapi/multi-file/components/pets.yaml b/openapi/multi-file/components/pets.yaml deleted file mode 100644 index 020aa0686..000000000 --- a/openapi/multi-file/components/pets.yaml +++ /dev/null @@ -1,145 +0,0 @@ -components: - schemas: - Id: - type: integer - format: int64 - readOnly: true - Tag: - type: object - properties: - id: - description: Tag ID - allOf: - - $ref: '#/components/schemas/Id' - name: - description: Tag name - type: string - minLength: 1 - xml: - name: Tag - Category: - type: object - properties: - id: - description: Category ID - allOf: - - $ref: '#/components/schemas/Id' - name: - description: Category name - type: string - minLength: 1 - sub: - description: Test Sub Category - type: object - properties: - prop1: - type: string - description: Dumb Property - xml: - name: Category - Cat: - description: A representation of a cat - allOf: - - $ref: '#/components/schemas/Pet' - - type: object - properties: - huntingSkill: - type: string - description: The measured skill for hunting - default: lazy - example: adventurous - enum: - - clueless - - lazy - - adventurous - - aggressive - required: - - huntingSkill - Dog: - description: A representation of a dog - allOf: - - $ref: '#/components/schemas/Pet' - - type: object - properties: - packSize: - type: integer - format: int32 - description: The size of the pack the dog is from - default: 1 - minimum: 1 - required: - - packSize - HoneyBee: - description: A representation of a honey bee - allOf: - - $ref: '#/components/schemas/Pet' - - type: object - properties: - honeyPerDay: - type: number - description: Average amount of honey produced per day in ounces - example: 3.14 - multipleOf: .01 - required: - - honeyPerDay - Pet: - type: object - required: - - name - - photoUrls - discriminator: - propertyName: petType - mapping: - cat: '#/components/schemas/Cat' - dog: '#/components/schemas/Dog' - bee: '#/components/schemas/HoneyBee' - properties: - id: - externalDocs: - description: 'Find more info here' - url: 'https://example.com' - description: Pet ID - allOf: - - $ref: '#/components/schemas/Id' - category: - description: Categories this pet belongs to - allOf: - - $ref: '#/components/schemas/Category' - name: - description: The name given to a pet - type: string - example: Guru - photoUrls: - description: The list of URL to a cute photos featuring pet - type: array - maxItems: 20 - xml: - name: photoUrl - wrapped: true - items: - type: string - format: url - friend: - allOf: - - $ref: '#/components/schemas/Pet' - tags: - description: Tags attached to the pet - type: array - minItems: 1 - xml: - name: tag - wrapped: true - items: - $ref: '#/components/schemas/Tag' - status: - type: string - description: Pet status in the store - enum: - - available - - pending - - sold - petType: - description: Type of a pet - type: string - xml: - name: Pet diff --git a/openapi/multi-file/openapi.yaml b/openapi/multi-file/openapi.yaml deleted file mode 100644 index 099d6d01e..000000000 --- a/openapi/multi-file/openapi.yaml +++ /dev/null @@ -1,1062 +0,0 @@ -openapi: 3.0.0 -servers: - - url: //petstore.swagger.io/v2 - description: Default server - - url: //petstore.swagger.io/sandbox - description: Sandbox server -info: - description: | - This is a sample server Petstore server. - You can find out more about Swagger at - [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). - For this sample, you can use the api key `special-key` to test the authorization filters. - - # Introduction - This API is documented in **OpenAPI format** and is based on - [Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team. - It was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo) - tool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard - OpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md). - - # OpenAPI Specification - This API is documented in **OpenAPI format** and is based on - [Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team. - It was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo) - tool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard - OpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md). - - # Cross-Origin Resource Sharing - This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). - And that allows cross-domain communication from the browser. - All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site. - - # Authentication - - Petstore offers two forms of authentication: - - API Key - - OAuth2 - OAuth2 - an open protocol to allow secure authorization in a simple - and standard method from web, mobile and desktop applications. - - - - version: 1.0.0 - title: Swagger Petstore [Automatic Page From File] - termsOfService: 'http://swagger.io/terms/' - contact: - name: API Support - email: apiteam@swagger.io - url: https://github.com/Redocly/redoc - x-logo: - url: 'https://redocly.github.io/redoc/petstore-logo.png' - altText: Petstore logo - license: - name: Apache 2.0 - url: 'http://www.apache.org/licenses/LICENSE-2.0.html' -externalDocs: - description: Find out how to create Github repo for your OpenAPI spec. - url: 'https://github.com/Rebilly/generator-openapi-repo' -tags: - - name: pet - description: Everything about your Pets - - name: store - description: Access to Petstore orders - - name: user - description: Operations about user - - name: pet_model - x-displayName: The Pet Model - description: | - - - name: store_model - x-displayName: The Order Model - description: | - -x-tagGroups: - - name: General - tags: - - pet - - store - - name: User Management - tags: - - user - - name: Models - tags: - - pet_model - - store_model -paths: - /pet: - parameters: - - name: Accept-Language - in: header - description: 'The language you prefer for messages. Supported values are en-AU, en-CA, en-GB, en-US' - example: en-US - required: false - schema: - type: string - default: en-AU - - name: cookieParam - in: cookie - description: Some cookie - required: true - schema: - type: integer - format: int64 - post: - tags: - - pet - summary: Add a new pet to the store - description: Add new pet to the store inventory. - operationId: addPet - responses: - '405': - description: Invalid input - security: - - petstore_auth: - - 'write:pets' - - 'read:pets' - x-codeSamples: - - lang: 'C#' - source: | - PetStore.v1.Pet pet = new PetStore.v1.Pet(); - pet.setApiKey("your api key"); - pet.petType = PetStore.v1.Pet.TYPE_DOG; - pet.name = "Rex"; - // set other fields - PetStoreResponse response = pet.create(); - if (response.statusCode == HttpStatusCode.Created) - { - // Successfully created - } - else - { - // Something wrong -- check response for errors - Console.WriteLine(response.getRawResponse()); - } - - lang: PHP - source: | - $form = new \PetStore\Entities\Pet(); - $form->setPetType("Dog"); - $form->setName("Rex"); - // set other fields - try { - $pet = $client->pets()->create($form); - } catch (UnprocessableEntityException $e) { - var_dump($e->getErrors()); - } - requestBody: - $ref: '#/components/requestBodies/Pet' - put: - tags: - - pet - summary: Update an existing pet - description: '' - operationId: updatePet - responses: - '400': - description: Invalid ID supplied - '404': - description: Pet not found - '405': - description: Validation exception - security: - - petstore_auth: - - 'write:pets' - - 'read:pets' - x-codeSamples: - - lang: PHP - source: | - $form = new \PetStore\Entities\Pet(); - $form->setPetId(1); - $form->setPetType("Dog"); - $form->setName("Rex"); - // set other fields - try { - $pet = $client->pets()->update($form); - } catch (UnprocessableEntityException $e) { - var_dump($e->getErrors()); - } - requestBody: - $ref: '#/components/requestBodies/Pet' - '/pet/{petId}': - get: - tags: - - pet - summary: Find pet by ID - description: Returns a single pet - operationId: getPetById - parameters: - - name: petId - in: path - description: ID of pet to return - required: true - deprecated: true - schema: - type: integer - format: int64 - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: 'components/pets.yaml#/components/schemas/Pet' - application/xml: - schema: - $ref: 'components/pets.yaml#/components/schemas/Pet' - '400': - description: Invalid ID supplied - '404': - description: Pet not found - security: - - api_key: [] - post: - tags: - - pet - summary: Updates a pet in the store with form data - description: '' - operationId: updatePetWithForm - parameters: - - name: petId - in: path - description: ID of pet that needs to be updated - required: true - schema: - type: integer - format: int64 - responses: - '405': - description: Invalid input - security: - - petstore_auth: - - 'write:pets' - - 'read:pets' - requestBody: - content: - application/x-www-form-urlencoded: - schema: - type: object - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - delete: - tags: - - pet - summary: Deletes a pet - description: '' - operationId: deletePet - parameters: - - name: api_key - in: header - required: false - schema: - type: string - example: 'Bearer ' - - name: petId - in: path - description: Pet id to delete - required: true - schema: - type: integer - format: int64 - responses: - '400': - description: Invalid pet value - security: - - petstore_auth: - - 'write:pets' - - 'read:pets' - '/pet/{petId}/uploadImage': - post: - tags: - - pet - summary: uploads an image - description: '' - operationId: uploadFile - parameters: - - name: petId - in: path - description: ID of pet to update - required: true - schema: - type: integer - format: int64 - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - security: - - petstore_auth: - - 'write:pets' - - 'read:pets' - requestBody: - content: - application/octet-stream: - schema: - type: string - format: binary - /pet/findByStatus: - get: - tags: - - pet - summary: Finds Pets by status - description: Multiple status values can be provided with comma separated strings - operationId: findPetsByStatus - parameters: - - name: status - in: query - description: Status values that need to be considered for filter - required: true - style: form - schema: - type: array - minItems: 1 - maxItems: 3 - items: - type: string - enum: - - available - - pending - - sold - default: available - responses: - '200': - description: successful operation - content: - application/json: - schema: - type: array - items: - $ref: 'components/pets.yaml#/components/schemas/Pet' - application/xml: - schema: - type: array - items: - $ref: 'components/pets.yaml#/components/schemas/Pet' - '400': - description: Invalid status value - security: - - petstore_auth: - - 'write:pets' - - 'read:pets' - /pet/findByTags: - get: - tags: - - pet - summary: Finds Pets by tags - description: >- - Multiple tags can be provided with comma separated strings. Use tag1, - tag2, tag3 for testing. - operationId: findPetsByTags - deprecated: true - parameters: - - name: tags - in: query - description: Tags to filter by - required: true - style: form - schema: - type: array - items: - type: string - responses: - '200': - description: successful operation - content: - application/json: - schema: - type: array - items: - $ref: 'components/pets.yaml#/components/schemas/Pet' - application/xml: - schema: - type: array - items: - $ref: 'components/pets.yaml#/components/schemas/Pet' - '400': - description: Invalid tag value - security: - - petstore_auth: - - 'write:pets' - - 'read:pets' - /store/inventory: - get: - tags: - - store - summary: Returns pet inventories by status - description: Returns a map of status codes to quantities - operationId: getInventory - responses: - '200': - description: successful operation - content: - application/json: - schema: - type: object - additionalProperties: - type: integer - format: int32 - security: - - api_key: [] - /store/order: - post: - tags: - - store - summary: Place an order for a pet - description: '' - operationId: placeOrder - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - application/xml: - schema: - $ref: '#/components/schemas/Order' - '400': - description: Invalid Order - content: - application/json: - example: - status: 400 - message: 'Invalid Order' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - description: order placed for purchasing the pet - required: true - '/store/order/{orderId}': - get: - tags: - - store - summary: Find purchase order by ID - description: >- - For valid response try integer IDs with value <= 5 or > 10. Other values - will generated exceptions - operationId: getOrderById - parameters: - - name: orderId - in: path - description: ID of pet that needs to be fetched - required: true - schema: - type: integer - format: int64 - minimum: 1 - maximum: 5 - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - application/xml: - schema: - $ref: '#/components/schemas/Order' - '400': - description: Invalid ID supplied - '404': - description: Order not found - delete: - tags: - - store - summary: Delete purchase order by ID - description: >- - For valid response try integer IDs with value < 1000. Anything above - 1000 or nonintegers will generate API errors - operationId: deleteOrder - parameters: - - name: orderId - in: path - description: ID of the order that needs to be deleted - required: true - schema: - type: string - minimum: 1 - responses: - '400': - description: Invalid ID supplied - '404': - description: Order not found - /store/subscribe: - post: - tags: - - store - summary: Subscribe to the Store events - description: Add subscription for a store events - requestBody: - content: - application/json: - schema: - type: object - properties: - callbackUrl: - type: string - format: uri - description: This URL will be called by the server when the desired event will occur - example: https://myserver.com/send/callback/here - eventName: - type: string - description: Event name for the subscription - enum: - - orderInProgress - - orderShipped - - orderDelivered - example: orderInProgress - required: - - callbackUrl - - eventName - responses: - '201': - description: Subscription added - content: - application/json: - schema: - type: object - properties: - subscriptionId: - type: string - example: AAA-123-BBB-456 - callbacks: - orderInProgress: - '{$request.body#/callbackUrl}?event={$request.body#/eventName}': - servers: - - url: //callback-url.path-level/v1 - description: Path level server 1 - - url: //callback-url.path-level/v2 - description: Path level server 2 - post: - summary: Order in Progress (Summary) - description: A callback triggered every time an Order is updated status to "inProgress" (Description) - externalDocs: - description: Find out more - url: 'https://more-details.com/demo' - requestBody: - content: - application/json: - schema: - type: object - properties: - orderId: - type: string - example: '123' - timestamp: - type: string - format: date-time - example: '2018-10-19T16:46:45Z' - status: - type: string - example: 'inProgress' - application/xml: - schema: - type: object - properties: - orderId: - type: string - example: '123' - example: | - - - 123 - inProgress - 2018-10-19T16:46:45Z - - responses: - '200': - description: Callback successfully processed and no retries will be performed - content: - application/json: - schema: - type: object - properties: - someProp: - type: string - example: '123' - '299': - description: Response for cancelling subscription - '500': - description: Callback processing failed and retries will be performed - x-codeSamples: - - lang: 'C#' - source: | - PetStore.v1.Pet pet = new PetStore.v1.Pet(); - pet.setApiKey("your api key"); - pet.petType = PetStore.v1.Pet.TYPE_DOG; - pet.name = "Rex"; - // set other fields - PetStoreResponse response = pet.create(); - if (response.statusCode == HttpStatusCode.Created) - { - // Successfully created - } - else - { - // Something wrong -- check response for errors - Console.WriteLine(response.getRawResponse()); - } - - lang: PHP - source: | - $form = new \PetStore\Entities\Pet(); - $form->setPetType("Dog"); - $form->setName("Rex"); - // set other fields - try { - $pet = $client->pets()->create($form); - } catch (UnprocessableEntityException $e) { - var_dump($e->getErrors()); - } - put: - description: Order in Progress (Only Description) - servers: - - url: //callback-url.operation-level/v1 - description: Operation level server 1 (Operation override) - - url: //callback-url.operation-level/v2 - description: Operation level server 2 (Operation override) - requestBody: - content: - application/json: - schema: - type: object - properties: - orderId: - type: string - example: '123' - timestamp: - type: string - format: date-time - example: '2018-10-19T16:46:45Z' - status: - type: string - example: 'inProgress' - application/xml: - schema: - type: object - properties: - orderId: - type: string - example: '123' - example: | - - - 123 - inProgress - 2018-10-19T16:46:45Z - - responses: - '200': - description: Callback successfully processed and no retries will be performed - content: - application/json: - schema: - type: object - properties: - someProp: - type: string - example: '123' - orderShipped: - '{$request.body#/callbackUrl}?event={$request.body#/eventName}': - post: - description: | - Very long description - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor - incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis - nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. - Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu - fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in - culpa qui officia deserunt mollit anim id est laborum. - requestBody: - content: - application/json: - schema: - type: object - properties: - orderId: - type: string - example: '123' - timestamp: - type: string - format: date-time - example: '2018-10-19T16:46:45Z' - estimatedDeliveryDate: - type: string - format: date-time - example: '2018-11-11T16:00:00Z' - responses: - '200': - description: Callback successfully processed and no retries will be performed - orderDelivered: - 'http://notificationServer.com?url={$request.body#/callbackUrl}&event={$request.body#/eventName}': - post: - deprecated: true - summary: Order delivered - description: A callback triggered every time an Order is delivered to the recipient - requestBody: - content: - application/json: - schema: - type: object - properties: - orderId: - type: string - example: '123' - timestamp: - type: string - format: date-time - example: '2018-10-19T16:46:45Z' - responses: - '200': - description: Callback successfully processed and no retries will be performed - /user: - post: - tags: - - user - summary: Create user - description: This can only be done by the logged in user. - operationId: createUser - responses: - default: - description: successful operation - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - '/user/{username}': - get: - tags: - - user - summary: Get user by user name - description: '' - operationId: getUserByName - parameters: - - name: username - in: path - description: 'The name that needs to be fetched. Use user1 for testing. ' - required: true - schema: - type: string - responses: - '200': - description: successful operation - content: - application/json: - schema: - $ref: '#/components/schemas/User' - application/xml: - schema: - $ref: '#/components/schemas/User' - '400': - description: Invalid username supplied - '404': - description: User not found - put: - tags: - - user - summary: Updated user - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - name: username - in: path - description: name that need to be deleted - required: true - schema: - type: string - responses: - '400': - description: Invalid user supplied - '404': - description: User not found - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true - delete: - tags: - - user - summary: Delete user - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - name: username - in: path - description: The name that needs to be deleted - required: true - schema: - type: string - responses: - '400': - description: Invalid username supplied - '404': - description: User not found - /user/createWithArray: - post: - tags: - - user - summary: Creates list of users with given input array - description: '' - operationId: createUsersWithArrayInput - responses: - default: - description: successful operation - requestBody: - $ref: '#/components/requestBodies/UserArray' - /user/createWithList: - post: - tags: - - user - summary: Creates list of users with given input array - description: '' - operationId: createUsersWithListInput - responses: - default: - description: successful operation - requestBody: - $ref: '#/components/requestBodies/UserArray' - /user/login: - get: - tags: - - user - summary: Logs user into the system - description: '' - operationId: loginUser - parameters: - - name: username - in: query - description: The user name for login - required: true - schema: - type: string - - name: password - in: query - description: The password for login in clear text - required: true - schema: - type: string - responses: - '200': - description: successful operation - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - schema: - type: integer - format: int32 - X-Expires-After: - description: date in UTC when token expires - schema: - type: string - format: date-time - content: - application/json: - schema: - type: string - examples: - response: - value: OK - application/xml: - schema: - type: string - examples: - response: - value: OK - text/plain: - examples: - response: - value: OK - '400': - description: Invalid username/password supplied - /user/logout: - get: - tags: - - user - summary: Logs out current logged in user session - description: '' - operationId: logoutUser - responses: - default: - description: successful operation -components: - schemas: - ApiResponse: - type: object - properties: - code: - type: integer - format: int32 - type: - type: string - message: - type: string - Order: - type: object - properties: - id: - description: Order ID - allOf: - - $ref: 'components/pets.yaml#/components/schemas/Id' - petId: - description: Pet ID - allOf: - - $ref: 'components/pets.yaml#/components/schemas/Id' - quantity: - type: integer - format: int32 - minimum: 1 - default: 1 - shipDate: - description: Estimated ship date - type: string - format: date-time - status: - type: string - description: Order Status - enum: - - placed - - approved - - delivered - complete: - description: Indicates whenever order was completed or not - type: boolean - default: false - readOnly: true - requestId: - description: Unique Request Id - type: string - writeOnly: true - xml: - name: Order - User: - type: object - properties: - id: - $ref: 'components/pets.yaml#/components/schemas/Id' - pet: - oneOf: - - $ref: 'components/pets.yaml#/components/schemas/Pet' - - $ref: 'components/pets.yaml#/components/schemas/Tag' - username: - description: User supplied username - type: string - minLength: 4 - example: John78 - firstName: - description: User first name - type: string - minLength: 1 - example: John - lastName: - description: User last name - type: string - minLength: 1 - example: Smith - email: - description: User email address - type: string - format: email - example: john.smith@example.com - password: - type: string - description: >- - User password, MUST contain a mix of upper and lower case letters, - as well as digits - format: password - minLength: 8 - pattern: '/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/' - example: drowssaP123 - phone: - description: User phone number in international format - type: string - pattern: '/^\+(?:[0-9]-?){6,14}[0-9]$/' - example: +1-202-555-0192 - userStatus: - description: User status - type: integer - format: int32 - xml: - name: User - requestBodies: - Pet: - content: - application/json: - schema: - allOf: - - description: My Pet - title: Pettie - - $ref: 'components/pets.yaml#/components/schemas/Pet' - application/xml: - schema: - type: 'object' - properties: - name: - type: string - description: hooray - description: Pet object that needs to be added to the store - required: true - UserArray: - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/User' - description: List of user object - required: true - securitySchemes: - petstore_auth: - description: | - Get access to data while protecting your account credentials. - OAuth2 is also a safer and more secure way to give you access. - type: oauth2 - flows: - implicit: - authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' - scopes: - 'write:pets': modify pets in your account - 'read:pets': read your pets - api_key: - description: > - For this sample, you can use the api key `special-key` to test the - authorization filters. - type: apiKey - name: api_key - in: header - examples: - Order: - value: - quantity: 1 - shipDate: '2018-10-19T16:46:45Z' - status: placed - complete: false -x-webhooks: - newPet: - post: - summary: New pet - description: Information about a new pet in the systems - operationId: newPet - tags: - - pet - requestBody: - content: - application/json: - schema: - $ref: 'components/pets.yaml#/components/schemas/Pet' - responses: - '200': - description: Return a 200 status to indicate that the data was received successfully diff --git a/redocly.yaml b/redocly.yaml new file mode 100644 index 000000000..052d5f585 --- /dev/null +++ b/redocly.yaml @@ -0,0 +1,30 @@ +# See https://redocly.com/docs/cli/configuration/ + +apis: + # Update the apiName with your actual API name, and the version with your actual API version. + Horizon@0.0.1: + # Update the path to your OpenAPI root file + root: ./openapi/main.yaml + +lint: + extends: + - recommended + rules: + tag-description: off + operation-summary: error + no-unresolved-refs: error + no-unused-components: error + operation-2xx-response: error + operation-operationId: error + operation-singular-tag: error + no-enum-type-mismatch: error + no-identical-paths: error + no-ambiguous-paths: error + security-defined: off + +features.openapi: + generateCodeSamples: + languages: + - lang: curl + - lang: Node.js + - lang: Python \ No newline at end of file