Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit f9cee93

Browse files
committed
[CO-322] Fix the issue by replacing < with - and [] with __
[CO-322] Changelog entry [CO-322] pkgs/generate.sh
1 parent a712c51 commit f9cee93

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030

3131
- Improve type safety (and as a consequence, API documentation) of account indexes (CBR-306)
3232

33+
- The Swagger specification had names with illegal characters. These names
34+
where changed to be URL friendly. [PR #3595](https://github.com/input-output-hk/cardano-sl/pull/3595)
35+
3336
### Improvements
3437

3538
- Friendly error mistakes from deserializing invalid addresses instead of brutal 500 (CBR-283)

pkgs/default.nix

+2
Original file line numberDiff line numberDiff line change
@@ -17704,6 +17704,7 @@ license = stdenv.lib.licenses.mit;
1770417704
, http-client
1770517705
, http-client-tls
1770617706
, http-types
17707+
, insert-ordered-containers
1770717708
, ixset-typed
1770817709
, lens
1770917710
, memory
@@ -17924,6 +17925,7 @@ formatting
1792417925
hedgehog
1792517926
hspec
1792617927
hspec-core
17928+
insert-ordered-containers
1792717929
lens
1792817930
mtl
1792917931
normaldistribution

wallet-new/cardano-sl-wallet-new.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ test-suite wallet-new-specs
601601
, cardano-sl-core-test
602602
, cardano-sl-crypto
603603
, cardano-sl-chain
604+
, cardano-sl-util
604605
, cardano-sl-util-test
605606
, cardano-sl-wallet
606607
, cardano-sl-wallet-new

wallet-new/src/Cardano/Wallet/API/Response.hs

+5-2
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,14 @@ instance ToJSON a => MimeRender OctetStream (WalletResponse a) where
114114
instance (ToSchema a, Typeable a) => ToSchema (WalletResponse a) where
115115
declareNamedSchema _ = do
116116
let a = Proxy @a
117-
tyName = toText . show $ typeRep a
117+
tyName = toText . map sanitize . show $ typeRep a
118+
sanitize c
119+
| c `elem` (":/?#[]@!$&'()*+,;=" :: String) = '_'
120+
| otherwise = c
118121
aRef <- declareSchemaRef a
119122
respRef <- declareSchemaRef (Proxy @ResponseStatus)
120123
metaRef <- declareSchemaRef (Proxy @Metadata)
121-
pure $ NamedSchema (Just $ "WalletResponse<" <> tyName <> ">") $ mempty
124+
pure $ NamedSchema (Just $ "WalletResponse-" <> tyName) $ mempty
122125
& type_ .~ SwaggerObject
123126
& required .~ ["data", "status", "meta"]
124127
& properties .~

0 commit comments

Comments
 (0)