[Transition PyPIConGPU to pydantic] Proof-of-concept II: Remove schemata #5502
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.
_get_serialized#5501. Until the rebase, only the last three commits are new content.This is the second of a series of PRs relating to #5500.
This introduces one new functionality:
The schema validation falls back to requesting a schema directly from the class (which is hopefully a
pydantic.BaseModelin that case) if it can't find a pertinent one in the schema registry. This unfortunately only works for the immediate class at hand and does not apply to following references in other schemata. The latter would involve some bookkeeping to map the referenced URI to the corresponding Python class. Playing around with that a little yielded no really satisfying solutions.Given that
I haven't put to much effort into making referencing work. Instead, we can put wildcards where there are references currently.
I've applied this to two examples from #5501:
Grid3DandTimeStepSpec, but notAuto. Removing the reference inplugin.Plugin.jsonwould allow for plugins to contain arbitrary content and effectively circumvent all schema validation which is not what we want. Removing the plugin schemata should consider all plugins in one go instead.