Skip to content

Commit 78ceed8

Browse files
committed
update samples with worst-case-scenario swagger file
1 parent e14fdba commit 78ceed8

81 files changed

Lines changed: 2722 additions & 17 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bin/configs/kotlin-misk-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
generatorName: kotlin-misk
22
outputDir: samples/server/petstore/kotlin-misk-config
3-
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-kotlin-misk.yaml
44
templateDir: modules/openapi-generator/src/main/resources/kotlin-misk
55
validateSpec: false
66
useBeanValidation: true

bin/configs/kotlin-misk.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
generatorName: kotlin-misk
22
outputDir: samples/server/petstore/kotlin-misk
3-
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore-kotlin-misk.yaml
44
templateDir: modules/openapi-generator/src/main/resources/kotlin-misk
55
additionalProperties:
66
hideGenerationTimestamp: "true"

modules/openapi-generator/src/test/resources/3_0/issue_10865_default_values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ paths:
154154
default:
155155
- item0
156156

157+
- name: qs0
158+
in: query
159+
required: false
160+
type: string
161+
default: "hello $world, backslash=\\, quote=\", end */"
162+
description: "String with $dollar, backslash, quote, comment-close in default"
157163

158164
responses:
159165
"200":
@@ -178,3 +184,7 @@ definitions:
178184
n1:
179185
type: number
180186
default: 68
187+
s0:
188+
type: string
189+
default: "hello $world, backslash=\\, quote=\", end */"
190+
description: "String property with $dollar, backslash, quote, comment-close in default"

modules/openapi-generator/src/test/resources/3_0/kotlin/echo_api.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,34 @@ paths:
602602
text/plain:
603603
schema:
604604
type: string
605+
# To test string escaping edge cases in Kotlin (Issue 20502)
606+
/echo/string-escaping/{$paramName}:
607+
get:
608+
tags:
609+
- echo
610+
summary: "Test $-in-path-param escaping"
611+
description: "Tests that path params with $dollar, backslash \\ and quote \" are properly escaped"
612+
operationId: "tests/echo/string-escaping/{$paramName}"
613+
parameters:
614+
- in: path
615+
name: "$paramName"
616+
required: true
617+
schema:
618+
type: string
619+
- in: query
620+
name: "filter$Type"
621+
required: false
622+
description: "Filter with $dollar in description and comment-close */"
623+
schema:
624+
type: string
625+
default: "default$Value with \\ and \""
626+
responses:
627+
'200':
628+
description: "ok"
629+
content:
630+
text/plain:
631+
schema:
632+
type: string
605633
components:
606634
securitySchemes:
607635
http_auth:
@@ -810,3 +838,14 @@ components:
810838
format: double
811839
minimum: 0.8
812840
maximum: 50.2
841+
StringEscapingEdgeCases:
842+
type: object
843+
description: "Model to test: $dollar, backslash \\, quote \", comment-close */"
844+
properties:
845+
dollarDefault:
846+
type: string
847+
description: "A string whose default has $dollar, backslash \\, quote \" and comment-close */"
848+
default: "hello $world, backslash=\\, quote=\", end */"
849+
regularProp:
850+
type: string
851+
description: "Regular property for baseline comparison"

0 commit comments

Comments
 (0)