Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Update apiextensions/v1 for JSON class #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/kube-dsl/dsl/apiextensions/v1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module KubeDSL::DSL::Apiextensions::V1
autoload :CustomResourceSubresources, 'kube-dsl/dsl/apiextensions/v1/custom_resource_subresources'
autoload :CustomResourceValidation, 'kube-dsl/dsl/apiextensions/v1/custom_resource_validation'
autoload :ExternalDocumentation, 'kube-dsl/dsl/apiextensions/v1/external_documentation'
autoload :JSON, 'kube-dsl/dsl/apiextensions/v1/json'
autoload :JSONSchemaProps, 'kube-dsl/dsl/apiextensions/v1/json_schema_props'
autoload :ServiceReference, 'kube-dsl/dsl/apiextensions/v1/service_reference'
autoload :WebhookClientConfig, 'kube-dsl/dsl/apiextensions/v1/webhook_client_config'
Expand Down
12 changes: 6 additions & 6 deletions lib/kube-dsl/dsl/apiextensions/v1/json_schema_props.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ module KubeDSL::DSL::Apiextensions::V1
class JSONSchemaProps < ::KubeDSL::DSLObject
value_field :additional_items
value_field :additional_properties
array_field(:all_of) { KubeDSL::DSL::Apiextensions::V1::JSONSchemaProps.new }
array_field(:any_of) { KubeDSL::DSL::Apiextensions::V1::JSONSchemaProps.new }
array_field(:all_ofs) { KubeDSL::DSL::Apiextensions::V1::JSONSchemaProps.new }
array_field(:any_ofs) { KubeDSL::DSL::Apiextensions::V1::JSONSchemaProps.new }
value_field :default
key_value_field(:definitions, format: :string)
key_value_field(:dependencies, format: :string)
value_field :description
array_field(:enum) { KubeDSL::DSL::Apiextensions::V1::JSON.new }
array_field(:enums) { KubeDSL::DSL::Apiextensions::V1::JSON.new }
value_field :example
value_field :exclusive_maximum
value_field :exclusive_minimum
Expand All @@ -29,7 +29,7 @@ class JSONSchemaProps < ::KubeDSL::DSLObject
value_field :multiple_of
object_field(:not_field) { KubeDSL::DSL::Apiextensions::V1::JSONSchemaProps.new }
value_field :nullable
array_field(:one_of) { KubeDSL::DSL::Apiextensions::V1::JSONSchemaProps.new }
array_field(:one_ofs) { KubeDSL::DSL::Apiextensions::V1::JSONSchemaProps.new }
value_field :pattern
key_value_field(:pattern_properties, format: :string)
key_value_field(:properties, format: :string)
Expand Down Expand Up @@ -100,7 +100,7 @@ def serialize
result[:example] = example
result[:exclusiveMaximum] = exclusive_maximum
result[:exclusiveMinimum] = exclusive_minimum
result[:externalDocs] = external_docs.serialize
#result[:externalDocs] = external_docs.serialize
result[:format] = format
result[:id] = id
result[:items] = items
Expand All @@ -113,7 +113,7 @@ def serialize
result[:minProperties] = min_properties
result[:minimum] = minimum
result[:multipleOf] = multiple_of
result[:not] = not_field.serialize
# result[:not] = not_field.serialize
result[:nullable] = nullable
result[:oneOf] = one_ofs.map(&:serialize)
result[:pattern] = pattern
Expand Down