Skip to content

Commit 8b88bdc

Browse files
authored
Merge pull request #21 from zweidenker/development
Development
2 parents 58c8816 + 7c5d2a5 commit 8b88bdc

File tree

82 files changed

+187
-71
lines changed

Some content is hidden

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

82 files changed

+187
-71
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
baselines
22
mocketry: spec
33
spec baseline: 'Mocketry' with: [
4-
spec repository: 'github://dionisiydk/Mocketry:v4.0.x'. ]
4+
spec repository: 'github://dionisiydk/Mocketry:v4.0.x'. ]

source/OpenAPI-Core-Tests.package/OAParsingTests.class/instance/operationObjectJSON.st

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ operationObjectJSON
1515
"schema": {
1616
"type": "string"
1717
}
18+
},
19+
{
20+
"name": "secondId",
21+
"in": "query",
22+
"description": "an ID to have more than one",
23+
"schema": {
24+
"type": "string"
25+
}
1826
}
1927
],
2028
"requestBody": {

source/OpenAPI-Core-Tests.package/OAParsingTests.class/instance/petStoreApiJsonString.st

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,15 @@ petStoreApiJsonString
113113
"schema": {
114114
"type": "string"
115115
}
116-
}
116+
},
117+
{
118+
"name": "secondId",
119+
"in": "query",
120+
"description": "just an ID to have more than one",
121+
"schema": {
122+
"type": "string"
123+
}
124+
}
117125
],
118126
"responses": {
119127
"200": {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
tests
2+
testOpenAPISpecHasSortedParameters
3+
| api string json parameters |
4+
api := OpenAPI fromString: self petStoreApiJsonString.
5+
string := api specString.
6+
json := NeoJSONObject fromString: string.
7+
parameters := (json paths at: #'/pets/{petId}') get parameters.
8+
self assert: parameters size equals: 2.
9+
self assert: parameters first name equals: #petId.
10+
self assert: parameters second name equals: #secondId
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
reading
2+
extractParameter: aCall
3+
^ parameter read: (aCall request headers at: parameter name ifAbsent: [ ^ nil ])
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
as yet unclassified
22
read: value object: object
3-
^ schema read: value object: object
3+
^ [schema read: value object: object] on: JSONSchemaError do: [ :ex |
4+
OAInvalidFormat signal: ex description
5+
]

source/OpenAPI-Core.package/OAOperation.class/class/neoJsonMapping..st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ neoJsonMapping: mapper
44
for: self
55
do: [ :mapping |
66
mapping mapInstVars: #(tags summary description externalDocs operationId responses callbacks deprecated security servers).
7-
(mapping mapInstVar: #parameters) valueSchema: #ParameterList.
7+
(mapping mapAccessor: #parametersSortedByName mutator: #parameters: to: #parameters) valueSchema: #ParameterList.
88
(mapping mapInstVar: #requestBody) valueSchema: OARequestBody.
99
(mapping mapAccessor: #responses) valueSchema: #ResponsesDictionary. ].
1010
mapper

source/OpenAPI-Core.package/OAOperation.class/instance/deprecated1..st

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
reading
2-
initializeValuesOn: object fromRequest: request
2+
initializeValuesOn: aCall fromRequest: request
33
parameters ifNotNil: [
44
parameters do: [ :each |
5-
each writeParameterValueOn: object request: request]].
5+
each
6+
writeParameterValueOn: aCall parameterValueDelegate
7+
request: request]].
68
requestBody ifNotNil: [
7-
(requestBody readFrom: request object: object) ]
9+
(requestBody
10+
readFrom: request
11+
object: aCall bodyValueDelegate ) ]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
accessing
2+
parametersSortedByName
3+
parameters ifNil: [ ^ nil ].
4+
^ parameters sorted: [ :a :b | a name < b name ]

0 commit comments

Comments
 (0)