Skip to content

Commit 707dab1

Browse files
committed
Add broken input
1 parent 889aaf7 commit 707dab1

3 files changed

Lines changed: 39 additions & 0 deletions

File tree

cli/example/simple-ref.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
openapi: 3.0.1
2+
info:
3+
title: "Simple Ref"
4+
version: 1.0.0
5+
components:
6+
schemas:
7+
Forbidden:
8+
$ref: "#/components/schemas/Message"
9+
Message:
10+
type: object
11+
properties:
12+
msg:
13+
type: string
14+
required:
15+
- msg
16+
17+
responses:
18+
Forbidden:
19+
description: Wrong credentials
20+
content:
21+
application/json:
22+
schema:
23+
$ref: "#/components/schemas/Forbidden"
24+
paths:
25+
"/api":
26+
get:
27+
responses:
28+
200:
29+
$ref: "#/components/schemas/Forbidden"

cli/example/src/Example.elm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import PatreonApi.Types
1818
import RealworldConduitApi.Api
1919
import RealworldConduitApi.Types
2020
import RecursiveAllofRefs.Types
21+
import SimpleRef.Json
2122
import SingleEnum.Types
2223
import Trustmark.Api
2324
import Trustmark.TradeCheck.Api
@@ -41,6 +42,10 @@ type alias Model =
4142

4243
init : () -> ( Model, Cmd Msg )
4344
init () =
45+
let
46+
_ =
47+
SimpleRef.Json.decodeForbidden
48+
in
4449
( {}
4550
, Cmd.batch
4651
[ RealworldConduitApi.Api.getArticle

cli/src/TestGenScript.elm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ run =
106106
telegramBot =
107107
OpenApi.Config.inputFrom (OpenApi.Config.File "./example/telegram-bot.json")
108108

109+
simpleRef : OpenApi.Config.Input
110+
simpleRef =
111+
OpenApi.Config.inputFrom (OpenApi.Config.File "./example/simple-ref.yaml")
112+
109113
bug : Int -> OpenApi.Config.Input
110114
bug n =
111115
OpenApi.Config.inputFrom (OpenApi.Config.File ("./example/openapi-generator-bugs/" ++ String.fromInt n ++ ".yaml"))
@@ -129,6 +133,7 @@ run =
129133
|> OpenApi.Config.withInput binaryResponse
130134
|> OpenApi.Config.withInput nullableEnum
131135
|> OpenApi.Config.withInput cookieAuth
136+
|> OpenApi.Config.withInput simpleRef
132137
|> OpenApi.Config.withInput (bug 7889)
133138
|> OpenApi.Config.withInput (bug 10398)
134139
|> OpenApi.Config.withInput (bug 16104)

0 commit comments

Comments
 (0)