NAME
IO::K8s::ApiextensionsApiserver::Pkg::Apis::Apiextensions::V1::JSONSchemaPropsOrArray - JSONSchemaPropsOrArray represents a value that can either be a JSONSchemaProps or an array of JSONSchemaProps. Mainly here for serialization purposes.
VERSION
version 1.106
DESCRIPTION
The union type behind items in a CRD schema. Upstream it serializes as the bare alternative, never as a tagged wrapper:
items: { type: string } # single schema -> schema
items: [ {...}, {...} ] # tuple -> schemas
Exactly one arm is populated, and which one it was survives a round trip: a single schema never turns into a one-element array, and an array never collapses into a single schema.
my $items = $props->items;
if ($items->is_schema) { ... $items->schema ... }
else { ... $items->schemas ... }
schema
The single-schema arm: a IO::K8s::ApiextensionsApiserver::Pkg::Apis::Apiextensions::V1::JSONSchemaProps, or undef when the array arm is in use.
schemas
The array arm: an ArrayRef of JSONSchemaProps, or undef when the single schema arm is in use. An empty ArrayRef is a populated arm and serializes as [].
is_schema
True when the single-schema arm is in use, false when the array arm is.
FROM_STRUCT
my $items = $class->FROM_STRUCT($struct, $k8s);
Inflation hook called by "struct_to_object" in IO::K8s. An ArrayRef fills schemas, anything else fills schema.
TO_JSON
Returns the bare arm: an ArrayRef of serialized schemas, or the single serialized schema.
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/pplu/io-k8s-p5/issues.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHORS
Torsten Raudssus <getty@cpan.org>
Jose Luis Martinez Torres <jlmartin@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2018-2026 by Jose Luis Martinez Torres <jlmartin@cpan.org>.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004