Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use haskell datatype names for swagger objects #184

Merged
merged 1 commit into from
Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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