Skip to content

Vital Fixes #111

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

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Add an example for a newtype in the schema, and output all schemas fr…
…om the spec in the test
  • Loading branch information
Dan Fithian committed May 24, 2024
commit 31fc2d6218adf67739d49cce6ab560034ff8b407
2 changes: 1 addition & 1 deletion nix/tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let
extraFlags = extraFlags;
};
};
goldenTestCode = generateCode { fileName = "z_complex_self_made_example.yml"; };
goldenTestCode = generateCode { fileName = "z_complex_self_made_example.yml"; extraFlags = [ "--output-all-schemas" ]; };
exampleGeneratedCode = generateCode { fileName = "petstore.yaml"; };
codeForSpecsLevelOne = [
(generateCode { fileName = "google-payment.json"; })
Expand Down
2 changes: 2 additions & 0 deletions specifications/z_complex_self_made_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,8 @@ components:
- $ref: '#/components/schemas/Test9'
- $ref: '#/components/schemas/Test10'
- $ref: '#/components/schemas/Value'
CatWrapper:
$ref: '#/components/schemas/Cat'
parameters:
PetParameters:
name: petId
Expand Down
6 changes: 6 additions & 0 deletions testing/golden-output/src/OpenAPI/TypeAlias.hs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified OpenAPI.Common
import {-# SOURCE #-} OpenAPI.Types.Cat
import {-# SOURCE #-} OpenAPI.Types.Dog


Expand Down Expand Up @@ -63,3 +64,8 @@ type Test10 = GHC.Base.NonEmpty Data.Text.Internal.Text
--
--
type Test = Data.Text.Internal.Text

-- | Defines an alias for the schema located at @components.schemas.CatWrapper@ in the specification.
--
--
type CatWrapper = Cat