You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: openapi-processor-core/src/test/groovy/com/github/hauner/openapi/core/converter/DataTypeConverterPrimitiveTypeMappingSpec.groovy
+50Lines changed: 50 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -76,6 +76,56 @@ paths:
76
76
parameter.dataType.name =='ZonedDateTime'
77
77
}
78
78
79
+
void"primitive type dose not match primitive global type mapping with format" () {
80
+
def openApi = parse ("""\
81
+
openapi: 3.0.2
82
+
83
+
info:
84
+
title: API
85
+
version: 1.0.0
86
+
87
+
paths:
88
+
/foo:
89
+
get:
90
+
parameters:
91
+
- in: query
92
+
name: foo
93
+
schema:
94
+
type: array
95
+
items:
96
+
type: string
97
+
responses:
98
+
200:
99
+
description: response
100
+
content:
101
+
application/*:
102
+
schema:
103
+
type: string
104
+
format: binary
105
+
106
+
""")
107
+
108
+
when:
109
+
def options =newApiOptions(
110
+
packageName: 'pkg',
111
+
typeMappings: [
112
+
newTypeMapping (
113
+
'string',
114
+
'binary',
115
+
'io.openapiprocessor.Bar')
116
+
])
117
+
118
+
Api api =newApiConverter (options, newFrameworkBase ())
119
+
.convert (openApi)
120
+
121
+
then:
122
+
def itf = api.interfaces.first ()
123
+
def ep = itf.endpoints.first ()
124
+
def parameter = ep.parameters.first ()
125
+
parameter.dataType.packageName =='java.lang'
126
+
parameter.dataType.name =='String[]'
127
+
}
128
+
79
129
void"converts named primitive type to java type via global type mapping" () {
0 commit comments