forInnerType method
Returns a JsonSchemaOptions for use with an inner type.
For example, when writing the type of an item in an array or a property in an object, this method can be used to ensure the type is fully written even if the original options set startObject or endObject to false. This method also sets nullable to false.
Implementation
JsonSchemaOptions forInnerType() {
if (startObject && endObject && !nullable) {
return this;
}
return JsonSchemaOptions(
startObject: true,
endObject: true,
nullable: false,
useRefsForNestedTypes: useRefsForNestedTypes,
externalTypes: externalTypes,
);
}