Update OpenAPIKit to v4
Context
Duplicate of apple/swift-openapi-generator#830. This PR implements the additional changes/fixes for issues surfaced in the original PR
Summary
- Move OpenAPIKit to 4.x
- Refresh handling of null values
- Fix tests
Details
- Bump OpenAPIKit version so we target 4.x, and raise the Yams requirement to 5.1+
- Update wording in
testEmitsComplexOpenAPIParsingErrorandtestSchemaWarningsForwardedToGeneratorDiagnostics(Tests/OpenAPIGeneratorCoreTests/Parser/Test_YamsParser.swift,Tests/OpenAPIGeneratorCoreTests/Translator/TypesTranslator/Test_translateSchemas.swift) - Update checks for null values in
Sources/_OpenAPIGeneratorCore/Translator/CommonTranslations/translateRawEnum.swift - Update OpenAPI.Content.Encoding usage according to the OpenAPIKit v4 migration guide in
Tests/OpenAPIGeneratorCoreTests/Translator/TypeAssignment/Test_TypeMatcher.swift
Testing
- ✅
swift test - CI run
Fixes #821
Thank you @iT0ny, which of the changes were required when bumping the OpenAPIKit version, and which ones were nice to have?
Thank you @iT0ny, which of the changes were required when bumping the OpenAPIKit version, and which ones were nice to have?
All of them are required, tests mentioned in the PR message were failing. + there was an issue with nil checks after the version bump
updated user.email to correctly point to my GitHub email address
Heads up that because of a change that merged into main between when this PR was opened and now, you'll need to require OpenAPIKit v4.3.1 or greater once you've rebased on latest main.
Thanks, done! @mattpolzin
@czechboy0 more of a procedural question: what is your versioning strategy around bumping OpenAPIKit major versions?
Some potential considerations:
- Getting to version 4 of OpenAPIKit unlocks the ability to build external dereferencing into the generator, but getting to OpenAPIKit v5 will unlock OAS 3.2.0 features.
- I can't say how quickly I'll be able to get v5 out because OAS 3.2.0 actually represents a pretty substantial list of additions to the spec.
TBD, but it's possible we'll do a leap from 3 to 5 directly, as even moving to 4 would require a bit more qualification on my end that I don't have time for right now.
@czechboy0 I nerd sniped myself into this same path, closing the draft PR I created when I realized this was already here. I just tacked on the "semver/patch" label to the PR, but I wasn't sure how we were tracking versions for this when it generates code.