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

Implement "inline schemas": ability to add type hints into the type providers' source documents #1447

Merged
merged 11 commits into from
Aug 8, 2022

Commits on Jul 9, 2022

  1. Add an InferenceMode enum for the json and xml providers to allow inf…

    …ering types from inline schema definitions
    
    Ensure backward compatibility + add doc
    mlaily committed Jul 9, 2022
    Configuration menu
    Copy the full SHA
    27398fb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a276c5c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8c4129f View commit details
    Browse the repository at this point in the history
  4. Actually implement inline schemas and support units of measure in them

    This means changing inferPrimitiveType to take a UnitsOfMeasureProvier parameter,
    and return InferedType instead of Type so we can set the units on the
    returned values in a way that will work with the rest of the code.
    mlaily committed Jul 9, 2022
    Configuration menu
    Copy the full SHA
    5a11c95 View commit details
    Browse the repository at this point in the history
  5. Implement the ValuesAndInlineSchemasOverrides inference mode

    where inline schemas types override value-inferred types
    instead of just adding new types to the list of inferred types.
    
    This requires adding metadata on InferedType.Primitive to know if the type
    should replace other types when merging them.
    
    This also requires adding metadata on InferedType.Heterogeneous
    to keep track of optionality inside an heterogeneous type.
    (Since we want to be able to transform a heterogeneous type back into a primitive type
    when the primitive type is supposed to override other primitive types)
    
    Preserving optionality in heterogeneous types effectively makes nulls
    and inline schemas both being considered at the same level of importance when merging.
    mlaily committed Jul 9, 2022
    Configuration menu
    Copy the full SHA
    350d06c View commit details
    Browse the repository at this point in the history
  6. Fix json conversion generator to support units of measures

    Not sure why the assert was there, but looking at the similar ConversionsGenerator
    gives me confidence it shouldn't be here anymore now that we can have
    units of measure in json...
    mlaily committed Jul 9, 2022
    Configuration menu
    Copy the full SHA
    3160620 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    fd5ab64 View commit details
    Browse the repository at this point in the history
  8. Add signature test cases

    The existing ones changed to take the BackwardCompatible inference mode.
    All Json and Xml cases that had value inference enabled have been copied
    to 3 new cases: one for each value of InferenceMode.
    
    The expected content is always the same: enabling inline schemas
    when no schema is defined in the source file should not change anything to the output.
    mlaily committed Jul 9, 2022
    Configuration menu
    Copy the full SHA
    1a847ec View commit details
    Browse the repository at this point in the history
  9. Fix tutorial

    mlaily committed Jul 9, 2022
    Configuration menu
    Copy the full SHA
    3a4d8d7 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    4353276 View commit details
    Browse the repository at this point in the history
  11. dotnet fake build -t Format

    mlaily committed Jul 9, 2022
    Configuration menu
    Copy the full SHA
    071b030 View commit details
    Browse the repository at this point in the history