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

Added writer setting to add type annotations #1946

Merged
merged 5 commits into from
Dec 14, 2020
Merged

Added writer setting to add type annotations #1946

merged 5 commits into from
Dec 14, 2020

Conversation

jonpayne
Copy link
Contributor

@jonpayne jonpayne commented Dec 4, 2020

Issues

This pull request fixes issue #1945.

Description

  • Added 'AlwaysAddTypeAnnotationsForDerivedTypes' to ODataMessageWriterSettings

  • Chagned JsonNoMetadataLevel to use 'JsonMinimalMetadataTypeNameOracle' when 'AlwaysAddTypeAnnotationsForDerivedTypes' is setting

  • Updated unit tests

Checklist (Uncheck if it is not completed)

  • Test cases added
  • Build and test with one-click build and test script passed

* Added 'AlwaysAddTypeAnnotationsForDerivedTypes' to
  ODataMessageWriterSettings

* Chagned JsonNoMetadataLevel to use 'JsonMinimalMetadataTypeNameOracle'
  when 'AlwaysAddTypeAnnotationsForDerivedTypes' is setting

* Updated unit tests
Copy link
Member

@xuzhg xuzhg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

@jonpayne jonpayne requested a review from xuzhg December 14, 2020 20:12
@@ -24,10 +24,25 @@ internal abstract class JsonLightMetadataLevel
/// </summary>
/// <param name="mediaType">The full media type being written. This media type must have a type/subtype of "application/json".</param>
/// <param name="metadataDocumentUri">The metadata document uri from the writer settings.</param>
/// <param name="alwaysAddTypeAnnotationsForDerivedTypes">When set, type annotations will be added for derived types, even when the metadata level is set to "None".</param>
Copy link
Member

@xuzhg xuzhg Dec 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alwaysAddTypeAnnotationsForDerivedTypes [](start = 25, length = 39)

should remove this param #Resolved

Copy link
Contributor Author

@jonpayne jonpayne Dec 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both model and writingResponse appear to have appropriate docs:

/// <param name="model">The edm model.</param>
#Closed

Copy link
Contributor Author

@jonpayne jonpayne Dec 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to remove incorrect alwaysAddTypeAnnotationsForDerivedTypes doc comment. #Resolved

Copy link
Member

@xuzhg xuzhg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Member

@mikepizzo mikepizzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

Copy link
Member

@mikepizzo mikepizzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@mikepizzo mikepizzo merged commit ec0a349 into OData:master Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants