Open
Description
Description
I was trying to generate classes from the provided OpenAPI schema (LinkableEntities), and the generator highlighted that there's a property in the required list for a type that isn't listed in the schema for it.
The command I used to find this (repo):
git clone https://github.com/apple/swift-openapi-generator
cd swift-openapi-generator
swift run swift-openapi-generator generate --mode types --output-directory . ~/src/swift-project/swift-docc/Sources/SwiftDocC/SwiftDocC.docc/Resources/LinkableEntities.json --dry-run
The specific error message was:
warning: A property name only appears in the required list, but not in the properties map - this is likely a typo; skipping this property. [context: foundIn=Components.Schemas.TopicImage (#/components/schemas/TopicImage)/identifier]
Looking at the OpenAPI JSON:
"TopicImage": {
"type": "object",
"required": [
"type",
"identifier"
],
"properties": {
"type": {
"type": "string",
"enum": ["icon", "card"]
},
"reference": {
"type": "string",
"format": "reference(ImageRenderReference)"
}
}
},
It looks like perhaps identifier
was renamed to reference
. Since this is a pretty new experimental feature, I wanted to check for correctness before submitting a pull request.
Checklist
- If possible, I've reproduced the issue using the
main
branch of this package. - This issue hasn't been addressed in an existing GitHub issue.
Expected Behavior
No response
Actual behavior
No response
Steps To Reproduce
The command I used to find this (repo):
git clone https://github.com/apple/swift-openapi-generator
cd swift-openapi-generator
swift run swift-openapi-generator generate --mode types --output-directory . ~/src/swift-project/swift-docc/Sources/SwiftDocC/SwiftDocC.docc/Resources/LinkableEntities.json --dry-run
The specific error message was:
warning: A property name only appears in the required list, but not in the properties map - this is likely a typo; skipping this property. [context: foundIn=Components.Schemas.TopicImage (#/components/schemas/TopicImage)/identifier]
Swift-DocC Version Information
Swift Compiler Version Information
Apple Swift version 6.1 (swift-6.1-RELEASE)
Target: arm64-apple-macosx15.0