The record is the text of the repair. The Results table is the last run of the row.
LOAD-FAIL (KeyNotFound: key 'BaselineOfOpenAPI')..project file and no src/.properties, so
Iceberg finds no package in src.OAContact, OAInfo, OAComponents and OAOperation,
which the code and the tests use, are not in the repository.#{...} that Pharo 14 does not read, and one
test uses a mock that does not pass visit: on.patches/alkalinan-pharo-openapi-generator.patch adds the
two project files and the four classes (as small as the tests need),
nests the JSON mapping of the info object, corrects the two tests and
names the present Mocketry.Load the package into a Pharo 14 image (build 791) with the load expression of the test run, file in the fixes file of the row if there is one, and run the test classes of the package.
"row 112"
Metacello new baseline: 'OpenAPI'; repository: 'github://alkalinan/pharo-openapi-generator:main/src'; onConflict: [:e | e useIncoming]; load: #('default').Last result of the package run (stock Cog and iospharo on the same image).
| Row | Label | Load | Stock Cog | iospharo VM |
|---|---|---|---|---|
| 112 | alkalinan-pharo-openapi-generator | ok | tests=16 P=16 F=0 E=0 S=0 T=0 X=0 | tests=16 P=16 F=0 E=0 S=0 T=0 X=0 |
diff --git a/.project b/.project
new file mode 100644
index 0000000..7c4006d
--- /dev/null
+++ b/.project
@@ -0,0 +1,3 @@
+{
+ 'srcDirectory' : 'src'
+}
diff --git a/src/.properties b/src/.properties
new file mode 100644
index 0000000..53a5454
--- /dev/null
+++ b/src/.properties
@@ -0,0 +1,3 @@
+{
+ #format : #tonel
+}
diff --git a/src/BaselineOfOpenAPI/BaselineOfOpenAPI.class.st b/src/BaselineOfOpenAPI/BaselineOfOpenAPI.class.st
index d190dfc..1c3a82e 100644
--- a/src/BaselineOfOpenAPI/BaselineOfOpenAPI.class.st
+++ b/src/BaselineOfOpenAPI/BaselineOfOpenAPI.class.st
@@ -46,7 +46,7 @@ BaselineOfOpenAPI >> jsonSchema: spec [
{ #category : #baselines }
BaselineOfOpenAPI >> mocketry: spec [
spec baseline: 'Mocketry' with: [
- spec repository: 'github://dionisiydk/Mocketry:v4.0.x'. ]
+ spec repository: 'github://dionisiydk/Mocketry'. ]
]
{ #category : #baselines }
diff --git a/src/OpenAPI-Core-Tests/OARequestBuilderTest.class.st b/src/OpenAPI-Core-Tests/OARequestBuilderTest.class.st
index 59dca83..8b5a97c 100644
--- a/src/OpenAPI-Core-Tests/OARequestBuilderTest.class.st
+++ b/src/OpenAPI-Core-Tests/OARequestBuilderTest.class.st
@@ -17,16 +17,19 @@ OARequestBuilderTest >> setUp [
{ #category : #tests }
OARequestBuilderTest >> testAccessors [
- | operation |
+ | operation payload |
operation := OAOperation new.
+ payload := Dictionary new
+ at: 'key' put: 'value';
+ yourself.
builder
operation: operation;
- body: #{'key' -> 'value'};
+ body: payload;
beforeSendBlock: [ :request | request ].
self assert: builder operation equals: operation.
- self assert: builder body equals: #{'key' -> 'value'}.
+ self assert: builder body equals: payload.
self assert: builder beforeSendBlock notNil.
]
diff --git a/src/OpenAPI-Core-Tests/OAVisitorSpy.class.st b/src/OpenAPI-Core-Tests/OAVisitorSpy.class.st
new file mode 100644
index 0000000..d54bb92
--- /dev/null
+++ b/src/OpenAPI-Core-Tests/OAVisitorSpy.class.st
@@ -0,0 +1,25 @@
+Class {
+ #name : #OAVisitorSpy,
+ #superclass : #OAVisitor,
+ #instVars : [
+ 'visitedOpenAPIs'
+ ],
+ #category : #'OpenAPI-Core-Tests'
+}
+
+{ #category : #initialization }
+OAVisitorSpy >> initialize [
+ super initialize.
+ visitedOpenAPIs := OrderedCollection new
+]
+
+{ #category : #visiting }
+OAVisitorSpy >> visitOpenAPI: anOpenAPI [
+ visitedOpenAPIs add: anOpenAPI.
+ super visitOpenAPI: anOpenAPI
+]
+
+{ #category : #accessing }
+OAVisitorSpy >> visitedOpenAPIs [
+ ^ visitedOpenAPIs
+]
diff --git a/src/OpenAPI-Core-Tests/OAVisitorTest.class.st b/src/OpenAPI-Core-Tests/OAVisitorTest.class.st
index bdfcc4b..27c66d3 100644
--- a/src/OpenAPI-Core-Tests/OAVisitorTest.class.st
+++ b/src/OpenAPI-Core-Tests/OAVisitorTest.class.st
@@ -22,16 +22,12 @@ OAVisitorTest >> setUp [
{ #category : #tests }
OAVisitorTest >> testVisit [
- | visitedObject |
-
- "Create a mock visitor that tracks visited objects"
- visitor := Mock new.
- visitor stub openApi willReturn: openAPI.
- visitor stub visitOpenAPI: Any.
-
- "Visit the OpenAPI object"
- visitor visit: openAPI.
-
- "Verify that visitOpenAPI: was called with the openAPI object"
- visitor should receive visitOpenAPI: openAPI.
-]
\ No newline at end of file
+ | spy |
+ "The visitor is a real OAVisitor that records what it visits. A Mocketry
+ mock cannot check this: a mock answers #visit: itself and never sends
+ #visitOpenAPI:."
+ spy := OAVisitorSpy new.
+ spy visit: openAPI.
+
+ self assert: spy visitedOpenAPIs asArray equals: { openAPI }
+]
diff --git a/src/OpenAPI-Core/OAComponents.class.st b/src/OpenAPI-Core/OAComponents.class.st
new file mode 100644
index 0000000..d09f48c
--- /dev/null
+++ b/src/OpenAPI-Core/OAComponents.class.st
@@ -0,0 +1,29 @@
+Class {
+ #name : #OAComponents,
+ #superclass : #Object,
+ #instVars : [
+ 'schemas'
+ ],
+ #category : #'OpenAPI-Core-Model'
+}
+
+{ #category : #visiting }
+OAComponents >> accept: aVisitor [
+ aVisitor visitComponents: self
+]
+
+{ #category : #initialization }
+OAComponents >> initialize [
+ super initialize.
+ schemas := Dictionary new
+]
+
+{ #category : #accessing }
+OAComponents >> schemas [
+ ^ schemas
+]
+
+{ #category : #accessing }
+OAComponents >> schemas: anObject [
+ schemas := anObject
+]
diff --git a/src/OpenAPI-Core/OAContact.class.st b/src/OpenAPI-Core/OAContact.class.st
new file mode 100644
index 0000000..ee8b34b
--- /dev/null
+++ b/src/OpenAPI-Core/OAContact.class.st
@@ -0,0 +1,51 @@
+Class {
+ #name : #OAContact,
+ #superclass : #Object,
+ #instVars : [
+ 'name',
+ 'url',
+ 'email'
+ ],
+ #category : #'OpenAPI-Core-Model'
+}
+
+{ #category : #'as yet unclassified' }
+OAContact class >> neoJsonMapping: mapper [
+ mapper for: self do: [ :mapping |
+ mapping mapInstVars: #( name url email ) ]
+]
+
+{ #category : #visiting }
+OAContact >> accept: aVisitor [
+ aVisitor visitContact: self
+]
+
+{ #category : #accessing }
+OAContact >> name [
+ ^ name
+]
+
+{ #category : #accessing }
+OAContact >> name: anObject [
+ name := anObject
+]
+
+{ #category : #accessing }
+OAContact >> url [
+ ^ url
+]
+
+{ #category : #accessing }
+OAContact >> url: anObject [
+ url := anObject
+]
+
+{ #category : #accessing }
+OAContact >> email [
+ ^ email
+]
+
+{ #category : #accessing }
+OAContact >> email: anObject [
+ email := anObject
+]
diff --git a/src/OpenAPI-Core/OAInfo.class.st b/src/OpenAPI-Core/OAInfo.class.st
new file mode 100644
index 0000000..85c1d10
--- /dev/null
+++ b/src/OpenAPI-Core/OAInfo.class.st
@@ -0,0 +1,86 @@
+Class {
+ #name : #OAInfo,
+ #superclass : #Object,
+ #instVars : [
+ 'title',
+ 'version',
+ 'description',
+ 'termsOfService',
+ 'contact',
+ 'license'
+ ],
+ #category : #'OpenAPI-Core-Model'
+}
+
+{ #category : #'as yet unclassified' }
+OAInfo class >> neoJsonMapping: mapper [
+ mapper for: self do: [ :mapping |
+ mapping mapInstVars: #( title version description termsOfService ).
+ (mapping mapInstVar: #contact) valueSchema: OAContact.
+ (mapping mapInstVar: #license) valueSchema: OALicense ]
+]
+
+{ #category : #visiting }
+OAInfo >> accept: aVisitor [
+ aVisitor visitInfo: self
+]
+
+{ #category : #accessing }
+OAInfo >> title [
+ ^ title
+]
+
+{ #category : #accessing }
+OAInfo >> title: anObject [
+ title := anObject
+]
+
+{ #category : #accessing }
+OAInfo >> version [
+ ^ version
+]
+
+{ #category : #accessing }
+OAInfo >> version: anObject [
+ version := anObject
+]
+
+{ #category : #accessing }
+OAInfo >> description [
+ ^ description
+]
+
+{ #category : #accessing }
+OAInfo >> description: anObject [
+ description := anObject
+]
+
+{ #category : #accessing }
+OAInfo >> termsOfService [
+ ^ termsOfService
+]
+
+{ #category : #accessing }
+OAInfo >> termsOfService: anObject [
+ termsOfService := anObject
+]
+
+{ #category : #accessing }
+OAInfo >> contact [
+ ^ contact
+]
+
+{ #category : #accessing }
+OAInfo >> contact: anObject [
+ contact := anObject
+]
+
+{ #category : #accessing }
+OAInfo >> license [
+ ^ license
+]
+
+{ #category : #accessing }
+OAInfo >> license: anObject [
+ license := anObject
+]
diff --git a/src/OpenAPI-Core/OAOperation.class.st b/src/OpenAPI-Core/OAOperation.class.st
new file mode 100644
index 0000000..eea2e12
--- /dev/null
+++ b/src/OpenAPI-Core/OAOperation.class.st
@@ -0,0 +1,62 @@
+Class {
+ #name : #OAOperation,
+ #superclass : #Object,
+ #instVars : [
+ 'operationId',
+ 'summary',
+ 'description',
+ 'parameters'
+ ],
+ #category : #'OpenAPI-Core-Model'
+}
+
+{ #category : #visiting }
+OAOperation >> accept: aVisitor [
+ aVisitor visitOperation: self
+]
+
+{ #category : #initialization }
+OAOperation >> initialize [
+ super initialize.
+ parameters := OrderedCollection new
+]
+
+{ #category : #accessing }
+OAOperation >> operationId [
+ ^ operationId
+]
+
+{ #category : #accessing }
+OAOperation >> operationId: anObject [
+ operationId := anObject
+]
+
+{ #category : #accessing }
+OAOperation >> summary [
+ ^ summary
+]
+
+{ #category : #accessing }
+OAOperation >> summary: anObject [
+ summary := anObject
+]
+
+{ #category : #accessing }
+OAOperation >> description [
+ ^ description
+]
+
+{ #category : #accessing }
+OAOperation >> description: anObject [
+ description := anObject
+]
+
+{ #category : #accessing }
+OAOperation >> parameters [
+ ^ parameters
+]
+
+{ #category : #accessing }
+OAOperation >> parameters: anObject [
+ parameters := anObject
+]
diff --git a/src/OpenAPI-Core/OpenAPI.class.st b/src/OpenAPI-Core/OpenAPI.class.st
index e304651..fef0b2e 100644
--- a/src/OpenAPI-Core/OpenAPI.class.st
+++ b/src/OpenAPI-Core/OpenAPI.class.st
@@ -17,7 +17,8 @@ Class {
{ #category : #'as yet unclassified' }
OpenAPI class >> neoJsonMapping: mapper [
mapper for: self do: [ :mapping |
- mapping mapInstVars: #( openapi info servers paths components security tags externalDocs ) ]
+ mapping mapInstVars: #( openapi servers paths components security tags externalDocs ).
+ (mapping mapInstVar: #info) valueSchema: OAInfo ]
]
{ #category : #'instance creation' }
State of 2026-11-20. Made from the test records of the iospharo project (a second Pharo VM). The fixes are proposals for review.