Skip to content

Commit 1210f37

Browse files
committed
Add "anyOfEnums" example in preparation of improving its codegen
1 parent e7805e4 commit 1210f37

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

example/anyOfEnums.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
openapi: 3.0.0
2+
info:
3+
title: Basic Router
4+
version: 1.0.0
5+
paths:
6+
"/":
7+
responses:
8+
200:
9+
description: Ok
10+
schema:
11+
"#ref": "#/components/schemas/ApiModule/$defs/MyEnums"
12+
components:
13+
schemas:
14+
Compact:
15+
enum:
16+
- VAR1
17+
- VAR2
18+
- VAR3
19+
ApiModule:
20+
"$defs":
21+
MyEnums:
22+
anyOf:
23+
- type: string
24+
enum:
25+
- VAR1
26+
- type: string
27+
enum:
28+
- VAR2
29+
- type: string
30+
enum:
31+
- VAR3

src/TestGenScript.elm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ run =
6565
gitHub =
6666
OpenApi.Config.inputFrom (OpenApi.Config.File "./example/github-spec.json")
6767

68+
anyOfEnums : OpenApi.Config.Input
69+
anyOfEnums =
70+
OpenApi.Config.inputFrom (OpenApi.Config.File "./example/anyOfEnums.yaml")
71+
6872
config : OpenApi.Config.Config
6973
config =
7074
OpenApi.Config.init "./generated"
@@ -80,6 +84,7 @@ run =
8084
|> OpenApi.Config.withInput trustmark
8185
|> OpenApi.Config.withInput trustmarkTradeCheck
8286
|> OpenApi.Config.withInput gitHub
87+
|> OpenApi.Config.withInput anyOfEnums
8388
in
8489
Pages.Script.withoutCliOptions
8590
(BackendTask.doEach

0 commit comments

Comments
 (0)