-
Notifications
You must be signed in to change notification settings - Fork 217
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 openapi3 for schema tests #2289
Conversation
- optics-extra-0.3 | ||
- optics-th-0.3.0.2 | ||
- optics-vl-0.2.1 | ||
- insert-ordered-containers-0.2.3.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a difficult to track down build failure with 0.2.3
(which is the lowest bound for openapi3). It seems it only fails on a certain combination of packages, so I can't provide an upstream PR without further investigation.
a1bd98e
to
7d9f0f5
Compare
specifications/api/swagger.yaml
Outdated
format: uri | ||
example: https://smash.cardano-mainnet.iohk.io/ | ||
type: string | ||
pattern: '(null|direct|https?:\/\/[a-zA-Z0-9-_~.]+/?)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The oneOf had an overlap, because it doesn't check the format. So I think it's better to provide a lax javascript regex.
370cf7e
to
0c5cc12
Compare
This broke all of nix |
845f2da
to
e172b25
Compare
@hasufell I've referenced the dependency (openapi3) from its github repository instead of its hackage package because the hackage index depends on which version of haskell.nix is used by the CI behind the scene. And the version we're currently using is too old so it doesn't know about openapi3. Bumping Haskell.nix is a possibility, but it sometimes can be quite some work which would be unnecessary now. |
Thanks for fixing the nix @KtorZ . @hasufell, for the record, here is the documentation about updating the pins, and I just added a link to the Haskell.nix ChangeLog file. |
I read that already and it didn't work:
|
What this means is that the Stackage snapshot doesn't contain indexed-profunctors. So it needed the change that @KtorZ added. The Haskell.nix rev is now updated on master anyway. I have pushed a fix. |
Can we add documentation about this? What are the options when this case happens and how to execute the different solutions. |
Sure. But note that the nix build is based on |
@rvl please don't do reverse merges back from master. It messes up the history and makes rebasing etc harder. |
What is the actual problem @hasufell? It should be easy for you to rebase, and then the merge commit disappears. |
That's only true if you rebase against upstream master and that now causes lots of other conflicts. Squashing isn't easily possible anymore either (which reduces merge conflicts during rebases against upstream branches). |
It's easy. There are two merge conflicts which you would have needed to resolve anyway before merging into master. |
I'd prefer not to have reverse merges in my branches. Thanks :) |
Co-authored-by: KtorZ <[email protected]> Co-authored-by: Rodney Lorrimar <[email protected]>
1a1b3bb
to
328ad66
Compare
Co-authored-by: KtorZ <[email protected]>
328ad66
to
9c40258
Compare
b8f2409
to
6b50bc8
Compare
LGTM, modulo the revision on cardano-addresses which we need to address (release for this one is coming today hopefully). |
bors try |
-- | Utility function to provide an ad-hoc 'ToSchema' instance for a definition: | ||
-- we simply look it up within the Swagger specification. | ||
declareSchemaForDefinition :: Text -> Declare (Definitions Schema) NamedSchema | ||
declareSchemaForDefinition ref = do | ||
let json = foldl' unsafeLookupKey specification ["components","schemas",ref] | ||
case Aeson.eitherDecode' $ replaceRefs $ Aeson.encode json of | ||
case Aeson.eitherDecode' $ Aeson.encode json of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -308,18 +308,12 @@ x-poolMetadataSource: &poolMetadataSource | |||
Pool metadata source. This sets the metadata fetching strategy. | |||
|
|||
Possible values are | |||
* null -> no fetching | |||
* none -> no fetching |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
tryBuild succeeded: |
Issue Number
ADP-417
Overview
servant-openapi
packageComments