From 715b481045daa0fcfb6f064d367bfa4614622c10 Mon Sep 17 00:00:00 2001 From: Leonardo Taglialegne Date: Fri, 30 Jan 2026 22:13:25 +0100 Subject: [PATCH 1/5] https://github.com/OpenAPITools/openapi-generator/issues/22530 --- cli/example/openapi-generator-bugs/22530.yaml | 43 +++++++++++++++++++ cli/src/TestGenScript.elm | 5 +++ 2 files changed, 48 insertions(+) create mode 100644 cli/example/openapi-generator-bugs/22530.yaml diff --git a/cli/example/openapi-generator-bugs/22530.yaml b/cli/example/openapi-generator-bugs/22530.yaml new file mode 100644 index 0000000..9b794db --- /dev/null +++ b/cli/example/openapi-generator-bugs/22530.yaml @@ -0,0 +1,43 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Bug 22530", + "version": "v0" + }, + "servers": [ + { + "url": "http://127.0.0.1:3000", + "description": "Generated server url" + } + ], + "paths": { + "/api/something": { + "get": { + "operationId": "something-controller_get", + "parameters": [], + "responses": { + "200": { + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "SOMETHING", + "SOMETHING_ELSE", + "SOMETHING_MORE" + ] + } + } + } + }, + "description": "OK" + } + }, + "tags": ["something-controller"] + } + } + }, + "components": {} +} diff --git a/cli/src/TestGenScript.elm b/cli/src/TestGenScript.elm index c8d63a3..75de082 100644 --- a/cli/src/TestGenScript.elm +++ b/cli/src/TestGenScript.elm @@ -106,6 +106,10 @@ run = telegramBot = OpenApi.Config.inputFrom (OpenApi.Config.File "./example/telegram-bot.json") + bug : Int -> OpenApi.Config.Input + bug n = + OpenApi.Config.inputFrom (OpenApi.Config.File ("./example/openapi-generator-bugs/" ++ String.fromInt n ++ ".yaml")) + profileConfig : OpenApi.Config.Config profileConfig = -- Slimmed config for profiling @@ -125,6 +129,7 @@ run = |> OpenApi.Config.withInput binaryResponse |> OpenApi.Config.withInput nullableEnum |> OpenApi.Config.withInput cookieAuth + |> OpenApi.Config.withInput (bug 22530) config : OpenApi.Config.Config config = From a5149cfc5a5829e1566d21ac8e65594ff5742eac Mon Sep 17 00:00:00 2001 From: Leonardo Taglialegne Date: Fri, 30 Jan 2026 16:50:41 +0100 Subject: [PATCH 2/5] https://github.com/OpenAPITools/openapi-generator/issues/10398 --- cli/example/openapi-generator-bugs/10398.yaml | 48 +++++++++++++++++++ cli/src/TestGenScript.elm | 1 + 2 files changed, 49 insertions(+) create mode 100644 cli/example/openapi-generator-bugs/10398.yaml diff --git a/cli/example/openapi-generator-bugs/10398.yaml b/cli/example/openapi-generator-bugs/10398.yaml new file mode 100644 index 0000000..12dfb26 --- /dev/null +++ b/cli/example/openapi-generator-bugs/10398.yaml @@ -0,0 +1,48 @@ +openapi: "3.0.0" +info: + version: 1.0.0 + title: Bug 10398 +servers: + - url: https://swapi.dev/api/ +paths: + /planets: + get: + tags: + - swapi + operationId: getPlanets + responses: + "200": + description: List of planets + content: + application/json: + schema: + $ref: "#/components/schemas/PlanetList" + /planets/{planetId}: + get: + tags: + - swapi + operationId: getPlanet + parameters: + - name: planetId + in: path + description: Planet ID + required: true + schema: + type: integer + responses: + "200": + description: Planet name + content: + application/json: + schema: + $ref: "#/components/schemas/Planet" +components: + schemas: + Planet: + type: string + description: Planet name + PlanetList: + type: array + description: List of planets + items: + $ref: "#/components/schemas/Planet" \ No newline at end of file diff --git a/cli/src/TestGenScript.elm b/cli/src/TestGenScript.elm index 75de082..0237f4e 100644 --- a/cli/src/TestGenScript.elm +++ b/cli/src/TestGenScript.elm @@ -129,6 +129,7 @@ run = |> OpenApi.Config.withInput binaryResponse |> OpenApi.Config.withInput nullableEnum |> OpenApi.Config.withInput cookieAuth + |> OpenApi.Config.withInput (bug 10398) |> OpenApi.Config.withInput (bug 22530) config : OpenApi.Config.Config From 9856b30f45aaf27aeadf17621a99dea6c7426b2b Mon Sep 17 00:00:00 2001 From: Leonardo Taglialegne Date: Fri, 30 Jan 2026 17:02:42 +0100 Subject: [PATCH 3/5] https://github.com/OpenAPITools/openapi-generator/issues/22119 --- cli/example/openapi-generator-bugs/22119.yaml | 28 +++++++++++++++++++ cli/src/TestGenScript.elm | 1 + 2 files changed, 29 insertions(+) create mode 100644 cli/example/openapi-generator-bugs/22119.yaml diff --git a/cli/example/openapi-generator-bugs/22119.yaml b/cli/example/openapi-generator-bugs/22119.yaml new file mode 100644 index 0000000..e3b6394 --- /dev/null +++ b/cli/example/openapi-generator-bugs/22119.yaml @@ -0,0 +1,28 @@ +{ + "openapi" : "3.0.1", + "info" : { + "title" : "Bug 22119", + "version" : "v0" + }, + "servers" : [ { + "url" : "http://127.0.0.1:4000", + "description" : "Generated server url" + } ], + "paths": {}, + "components" : { + "schemas" : { + "TestObject" : { + "type" : "object", + "properties" : { + "body" : { + "type" : "array", + "items": { + "type" : "string", + "enum" : [ "ENUM_FIRST", "ENUM_SECOND", "ENUM_THIRD" ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/cli/src/TestGenScript.elm b/cli/src/TestGenScript.elm index 0237f4e..f1a5fee 100644 --- a/cli/src/TestGenScript.elm +++ b/cli/src/TestGenScript.elm @@ -130,6 +130,7 @@ run = |> OpenApi.Config.withInput nullableEnum |> OpenApi.Config.withInput cookieAuth |> OpenApi.Config.withInput (bug 10398) + |> OpenApi.Config.withInput (bug 22119) |> OpenApi.Config.withInput (bug 22530) config : OpenApi.Config.Config From d584ac3640e5a8656386d1f392fac9ea717e2cf9 Mon Sep 17 00:00:00 2001 From: Leonardo Taglialegne Date: Fri, 30 Jan 2026 17:10:52 +0100 Subject: [PATCH 4/5] https://github.com/OpenAPITools/openapi-generator/issues/16104 --- cli/example/openapi-generator-bugs/16104.yaml | 88 +++++++++++++++++++ cli/src/TestGenScript.elm | 1 + 2 files changed, 89 insertions(+) create mode 100644 cli/example/openapi-generator-bugs/16104.yaml diff --git a/cli/example/openapi-generator-bugs/16104.yaml b/cli/example/openapi-generator-bugs/16104.yaml new file mode 100644 index 0000000..ad05e18 --- /dev/null +++ b/cli/example/openapi-generator-bugs/16104.yaml @@ -0,0 +1,88 @@ +{ + "components": { + "schemas": { + "Example": { + "discriminator": { + "mapping": { + "generic": "ExampleGeneric", + "images": "ExampleImages" + }, + "propertyName": "tag" + }, + "oneOf": [ + { + "$ref": "#/components/schemas/ExampleGeneric" + }, + { + "$ref": "#/components/schemas/ExampleImages" + } + ] + }, + "ExampleGeneric": { + "properties": { + "content": { + "type": "string" + }, + "tag": { + "enum": [ + "generic" + ], + "type": "string" + } + }, + "required": [ + "content", + "tag" + ], + "type": "object" + }, + "ExampleImages": { + "properties": { + "images": { + "items": { + "type": "string" + }, + "type": "array" + }, + "tag": { + "enum": [ + "images" + ], + "type": "string" + } + }, + "required": [ + "images", + "tag" + ], + "type": "object" + } + } + }, + "info": { + "title": "Bug 16104", + "version": "" + }, + "openapi": "3.0.0", + "paths": { + "/example": { + "get": { + "responses": { + "200": { + "content": { + "application/json;charset=utf-8": { + "schema": { + "items": { + "$ref": "#/components/schemas/Example" + }, + "type": "array" + } + } + }, + "description": "" + } + } + } + } + } +} \ No newline at end of file diff --git a/cli/src/TestGenScript.elm b/cli/src/TestGenScript.elm index f1a5fee..784c89d 100644 --- a/cli/src/TestGenScript.elm +++ b/cli/src/TestGenScript.elm @@ -130,6 +130,7 @@ run = |> OpenApi.Config.withInput nullableEnum |> OpenApi.Config.withInput cookieAuth |> OpenApi.Config.withInput (bug 10398) + |> OpenApi.Config.withInput (bug 16104) |> OpenApi.Config.withInput (bug 22119) |> OpenApi.Config.withInput (bug 22530) From ea9df9afe0893c478d6c572172753d34b04940d4 Mon Sep 17 00:00:00 2001 From: Leonardo Taglialegne Date: Tue, 3 Feb 2026 12:31:23 +0100 Subject: [PATCH 5/5] https://github.com/OpenAPITools/openapi-generator/issues/7889 --- cli/example/openapi-generator-bugs/7889.yaml | 30 ++++++++++++++++++++ cli/src/TestGenScript.elm | 1 + 2 files changed, 31 insertions(+) create mode 100644 cli/example/openapi-generator-bugs/7889.yaml diff --git a/cli/example/openapi-generator-bugs/7889.yaml b/cli/example/openapi-generator-bugs/7889.yaml new file mode 100644 index 0000000..16d6d13 --- /dev/null +++ b/cli/example/openapi-generator-bugs/7889.yaml @@ -0,0 +1,30 @@ +openapi: 3.0.0 +info: + version: 0.1.0-beta + title: Bug 7889 + +paths: + /articles: + get: + summary: Get articles + operationId: GetArticles + parameters: + - name: category + in: query + description: Comma separated list of categories to filter + required: false + schema: + # NOTE elm code generation for array type query params is buggy as of now. + type: array + items: + $ref: "#/components/schemas/articleCategory" + responses: + "200": + description: Articles +components: + schemas: + articleCategory: + type: string + enum: + - Travel + - Business \ No newline at end of file diff --git a/cli/src/TestGenScript.elm b/cli/src/TestGenScript.elm index 784c89d..9b046df 100644 --- a/cli/src/TestGenScript.elm +++ b/cli/src/TestGenScript.elm @@ -129,6 +129,7 @@ run = |> OpenApi.Config.withInput binaryResponse |> OpenApi.Config.withInput nullableEnum |> OpenApi.Config.withInput cookieAuth + |> OpenApi.Config.withInput (bug 7889) |> OpenApi.Config.withInput (bug 10398) |> OpenApi.Config.withInput (bug 16104) |> OpenApi.Config.withInput (bug 22119)