SerializationOptions
- class SerializationOptions
Options for SysML model serialization. Attribute options are ordered in descending precedence.
Members defined in
SerializationOptions(10 members)
RWAction to take on serialization errors.
RWIf true, serialize attributes even if they match their default values.
RWIf true, serialize derived attributes. Corresponds to
includesDerivedflag in the specification (KerML 10.3, Table 13):
RWIf true, serialize implicit elements. Only for attributes that are serialized. Corresponds to
includesImpliedflag in the specification (KerML 10.3, Table 13):
RWIf true, non-required attributes will be serialized even if they are null or empty.
RWIf true, serialize attributes even if they are redefined in the metamodel.
RWIf true, fields will be serialized using standard names
Configuration that instructs the writer to produce a minimal JSON without any redundant elements. Examples of redundant information that is avoided using the minimal configuration are:
Creates a copy with the specified options changed to the given ones.
Attributes
- property fail_action: syside.FailAction
Action to take on serialization errors.
- property include_default: bool
If true, serialize attributes even if they match their default values.
- property include_derived: bool
If true, serialize derived attributes. Corresponds to
includesDerivedflag in the specification (KerML 10.3, Table 13):Whether derived property values are included in the model interchange files.
Note: Syside does not construct all derived properties yet. Therefore, setting
options.include_derivedtoTruemay result in a JSON that does not satisfy the schema.
- property include_implied: bool
If true, serialize implicit elements. Only for attributes that are serialized. Corresponds to
includesImpliedflag in the specification (KerML 10.3, Table 13):Whether implied relationships are included in the model interchange files.
- property include_optional: bool
If true, non-required attributes will be serialized even if they are null or empty.
- property include_redefined: bool
If true, serialize attributes even if they are redefined in the metamodel.
- property use_standard_names: bool
If true, fields will be serialized using standard names
Methods
- __init__(use_standard_names: bool = True, include_derived: bool = False, include_redefined: bool = False, include_default: bool = False, include_optional: bool = False, include_implied: bool = False, fail_action: syside.FailAction = FailAction.Diagnose) None
- static minimal() syside.SerializationOptions
Configuration that instructs the writer to produce a minimal JSON without any redundant elements. Examples of redundant information that is avoided using the minimal configuration are:
including fields for null values;
including fields whose values match the default values;
including redefined fields that are duplicates of redefining fields;
including derived fields that can be computed from minimal JSON (for example, the result value of evaluating an expression);
including implied relationships.
- with_options(use_standard_names: bool | None = None, include_derived: bool | None = None, include_redefined: bool | None = None, include_default: bool | None = None, include_optional: bool | None = None, include_implied: bool | None = None) syside.SerializationOptions
Creates a copy with the specified options changed to the given ones.