lib/cocina/generator/schema_ref.rb in cocina-models-0.58.2 vs lib/cocina/generator/schema_ref.rb in cocina-models-0.59.0
- old
+ new
@@ -3,10 +3,10 @@
module Cocina
module Generator
# Class for generating from an openapi reference
class SchemaRef < SchemaBase
def generate
- if required
+ if required && !relaxed
"attribute(:#{name.camelize(:lower)}, #{schema_doc.name}.default { #{schema_doc.name}.new })"
else
"attribute :#{name.camelize(:lower)}, #{schema_doc.name}.optional.meta(omittable: true)"
end
end