Skip to content

Commit

Permalink
Merge pull request #184 from input-output-hk/akegalj/93/standard-swag…
Browse files Browse the repository at this point in the history
…ger-names

Use haskell datatype names for swagger objects
  • Loading branch information
KtorZ authored Apr 26, 2019
2 parents 687f125 + 69742ff commit cc79fcc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
22 changes: 11 additions & 11 deletions specifications/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ networkInformationSoftwareUpdate: &networkInformationSoftwareUpdate
#############################################################################

definitions:
Address: &address
ApiAddress: &ApiAddress
type: object
required:
- id
Expand Down Expand Up @@ -433,7 +433,7 @@ definitions:
metrics: *stakePoolMetrics
profit_margin: *stakePoolProfitMargin

Transaction: &transaction
ApiTransaction: &ApiTransaction
type: object
required:
- id
Expand All @@ -453,7 +453,7 @@ definitions:
outputs: *transactionOutputs
status: *transactionStatus

Wallet: &wallet
ApiWallet: &ApiWallet
type: object
required:
- id
Expand Down Expand Up @@ -656,7 +656,7 @@ responsesListWallets: &responsesListWallets
description: Ok
schema:
type: array
items: *wallet
items: *ApiWallet

responsesGetUTxOsStatistics: &responsesGetUTxOsStatistics
<<: *responsesErr404
Expand All @@ -671,14 +671,14 @@ responsesPostWallet: &responsesPostWallet
<<: *responsesErr415
202:
description: Accepted
schema: *wallet
schema: *ApiWallet

responsesGetWallet: &responsesGetWallet
<<: *responsesErr400
<<: *responsesErr404
200:
description: Ok
schema: *wallet
schema: *ApiWallet

responsesDeleteWallet: &responsesDeleteWallet
<<: *responsesErr400
Expand All @@ -694,7 +694,7 @@ responsesPutWallet: &responsesPutWallet
<<: *responsesErr415
200:
description: Ok
schema: *wallet
schema: *ApiWallet

responsesPutWalletPassphrase: &responsesPutWalletPassphrase
<<: *responsesErr400
Expand All @@ -716,7 +716,7 @@ responsesListTransactions: &responsesListTransactions
example: inserted-at 20190227T160329Z-20190101T042557Z/42
schema:
type: array
items: *transaction
items: &ApiTransaction

responsesPostTransaction: &responsesPostTransaction
<<: *responsesErr400
Expand All @@ -725,7 +725,7 @@ responsesPostTransaction: &responsesPostTransaction
<<: *responsesErr415
202:
description: Accepted
schema: *transaction
schema: &ApiTransaction

responsesPostTransactionFee: &responsesPostTransactionFee
<<: *responsesErr400
Expand All @@ -747,7 +747,7 @@ responsesListAddresses: &responsesListAddresses
description: Ok
schema:
type: array
items: *address
items: &ApiAddress

responsesListStakePools: &responsesListStakePools
200:
Expand All @@ -763,7 +763,7 @@ responsesJoinStakePool: &responsesJoinStakePool
<<: *responsesErr415
202:
description: Accepted
schema: *transaction
schema: &ApiTransaction

responsesQuitStakePool: &responsesQuitStakePool
<<: *responsesJoinStakePool
Expand Down
6 changes: 3 additions & 3 deletions test/unit/Cardano/Wallet/Api/TypesSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -509,10 +509,10 @@ specification =
msg = "Whoops! Failed to parse or find the api specification document: "

instance ToSchema ApiAddress where
declareNamedSchema _ = declareSchemaForDefinition "Address"
declareNamedSchema _ = declareSchemaForDefinition "ApiAddress"

instance ToSchema ApiWallet where
declareNamedSchema _ = declareSchemaForDefinition "Wallet"
declareNamedSchema _ = declareSchemaForDefinition "ApiWallet"

instance ToSchema WalletPostData where
declareNamedSchema _ = declareSchemaForDefinition "WalletPostData"
Expand All @@ -527,7 +527,7 @@ instance ToSchema PostTransactionData where
declareNamedSchema _ = declareSchemaForDefinition "PostTransactionData"

instance ToSchema ApiTransaction where
declareNamedSchema _ = declareSchemaForDefinition "Transaction"
declareNamedSchema _ = declareSchemaForDefinition "ApiTransaction"


-- | Utility function to provide an ad-hoc 'ToSchema' instance for a definition:
Expand Down

0 comments on commit cc79fcc

Please sign in to comment.