Repository navigation
fix referencing objects through multiple ref files - #112
Merged
Merged
Conversation
Owner
|
Can you point me to your schema - I'd like to make sure this scenario is covered in the tests |
Contributor
Author
|
I have used a minimal schema to show the issue {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"message": { "$ref": "mid/$defs/mid-obj" }
}
}mid.cfgdb: {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"mid-obj": {
"type": "object",
"properties": {
"name": { "$ref": "leaf/$defs/scalar" },
"inner": { "$ref": "leaf/$defs/comp" }
},
"additionalProperties": false
}
}
}leaf.cfgdb: {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"scalar": {
"type": "string"
},
"comp": {
"type": "object",
"properties": {
"a": { "$ref": "#/$defs/scalar" },
"b": { "$ref": "#/$defs/scalar" }
},
"additionalProperties": false
}
}
}building this with the existing struct __attribute__((packed)) Struct {
ContainedComp::Struct inner{};
ConfigDB::StringId name{};
};I believe this has never surfaced before since it just won't be an issue when a schema only has two files. |
Without revision, fails to build as `mid.h` missing references to `leaf.h`
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 my json-rpc schema, I use three layers of ref
When a params object referred to by json-rpc itself references an object in value-types, the object in value types is correctly put into the params object by value, but the include is put into json-rpc.h
This patch registeres the obejct with the correct intermediate file