You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes user wants not to override schema generation, but to post-process it.
One possible case is to add non-standard extensions, e.g. x-kubernetes-validations extension can be used to CustomResourceDefinition-s to add programmatic validation rules.
Proposed solution: add a new customize_with attribute which can be applied to the whole derive-ing container, e.g.
#[derive(JsonSchema)]#[schemars(customize_with = "customize")]structFoo{// ...}// this function will be called after schema for Foo is generated, and it can modify returned schemafncustomize(schema:&mut schemars::schema::Schema){// something like schema.extensions.insert("x-my-custom-extension", ...) here.}
The text was updated successfully, but these errors were encountered:
Sometimes user wants not to override schema generation, but to post-process it.
One possible case is to add non-standard extensions, e.g.
x-kubernetes-validations
extension can be used to CustomResourceDefinition-s to add programmatic validation rules.Proposed solution: add a new
customize_with
attribute which can be applied to the wholederive
-ing container, e.g.The text was updated successfully, but these errors were encountered: