fix: normalize OAS 3.1 schemas with type:[object,"null"] to set nullable:true correctly#24140
Open
Picazsoo wants to merge 19 commits into
Open
fix: normalize OAS 3.1 schemas with type:[object,"null"] to set nullable:true correctly#24140Picazsoo wants to merge 19 commits into
Picazsoo wants to merge 19 commits into
Conversation
This reverts commit 6a4bd10.
…g "null" set nullable:true correctly and preserve properties"" This reverts commit 74eb333.
… set nullable:true correctly and preserve properties" This reverts commit b0d188d.
…set nullable:true correctly and preserve properties" This reverts commit cb5aa49.
…et nullable:true correctly" This reverts commit 29c6207.
…set nullable:true correctly" This reverts commit f741e48.
… set nullable:true correctly and preserve properties" This reverts commit cf56cf5.
…g "null" set nullable:true correctly and preserve properties"" This reverts commit 500d93a.
…ng "null" set nullable:true correctly and preserve properties"" This reverts commit 7f0b9a6.
This reverts commit 68e6dff.
…failures setup-cpp internally adds ppa:ubuntu-toolchain-r/test, which fetches an external GPG key. This occasionally times out in CI, causing the node2 job to fail with 'Failed to install the llvm' even though the code is fine. Replace the wget/setup-cpp/source chain with a single apt-get install of clang, cmake, and ninja-build from Ubuntu's own repositories. No PPAs, no external GPG key fetches, no transient network failures. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tsdk pom.xml CMake warns 'No source or binary directory provided' when called without a positional source-dir argument or -S/-B flags. The warning notes this will become a fatal error in future CMake releases. Add '.' as the first cmake argument to explicitly set the source directory to the current directory, which matches the implicit behaviour and silences the warning. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The CI node2 job installs clang via apt, but cmake was defaulting to GCC because no compiler was explicitly specified. Add CMAKE_C_COMPILER=clang and CMAKE_CXX_COMPILER=clang++ to match the original intent of the setup, which previously used setup-cpp --compiler llvm. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The cpp-restsdk pom.xml uses cmake + make (Unix Makefiles generator). Ninja is never invoked, so ninja-build serves no purpose here. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In OAS 3.1, nullability is expressed as a type array, e.g.
type: [object, "null"]. The existingNORMALIZE_31SPECnormalization path failed to handle schemas that used this syntax and also had properties - it would not setnullable: true.The downstream effect: a
$refto such a schema in Kotlin-Spring would incorrectly receive@field:JsonSetter(nulls = Nulls.FAIL), which is wrong for nullable fields. This is how this bug was identified in #24139. Hence this fixes #24139.I had pretty big issues with failing CircleCI on node2. I discussed with github copilot how to fix the issues and the current approach using
setup-cppwas flagged as outdated and unnecessary. I implemented the suggested fix and it fixed the issues right away. I am tagging the C++ comittee to take a look at these unrelated changes as my experience with C/C++ is extremely limited - @ravinikam, @stkrwork, @etherealjoy, @MartinDelille, @muttleyxd, @aminyaPR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
Summary by cubic
Sets nullable:true for OAS 3.1 schemas whose type arrays include "null" while preserving properties, and makes Kotlin Spring skip @JsonSetter(nulls = Nulls.FAIL) on nullable $ref.
Stabilizes C++ CI by installing build tools via apt, adding "." to
cmake, forcing clang viaCMAKE_C_COMPILER/CMAKE_CXX_COMPILER, and removing unnecessaryninja-build.Written for commit b7807bd. Summary will update on new commits.