We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Allow configure EnableFullValidation to false:
EnableFullValidation
MessageWriterSettings = new ODataMessageWriterSettings { Indent = true, DisableMessageStreamDisposal = true, MessageQuotas = new ODataMessageQuotas { MaxReceivedMessageSize = Int64.MaxValue }, AutoComputePayloadMetadataInJson = true, };
https://github.com/OData/WebApi/blob/master/OData/src/System.Web.OData/OData/Formatter/ODataMediaTypeFormatter.cs#L81-L87
or Create a customer odata formatting attribute, and a custom OData controller base class:
+ [CustomODataFormatting] + public class CustomODataController : ODataController + { + } + + [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] + public class CustomODataFormattingAttribute : Attribute, IControllerConfiguration + { + public void Initialize(HttpControllerSettings controllerSettings, + HttpControllerDescriptor controllerDescriptor) + { + Func<IList<ODataMediaTypeFormatter>> getODataFormatters = + () => controllerSettings.Formatters.OfType<ODataMediaTypeFormatter>().ToList(); + + var odataFormatters = getODataFormatters(); + if (!odataFormatters.Any()) + { + new ODataFormattingAttribute().Initialize(controllerSettings, controllerDescriptor); + odataFormatters = getODataFormatters(); + } + + foreach (var formatter in odataFormatters) + { + formatter.MessageWriterSettings.EnableFullValidation = false; + }
Related ODataLib issue: OData/odata.net#179
The text was updated successfully, but these errors were encountered:
@hotchandanisagar @gkasturi Can we know your option on the issue?
Sorry, something went wrong.
No branches or pull requests
Allow configure
EnableFullValidation
to false:https://github.com/OData/WebApi/blob/master/OData/src/System.Web.OData/OData/Formatter/ODataMediaTypeFormatter.cs#L81-L87
or Create a customer odata formatting attribute, and a custom OData controller base class:
Related ODataLib issue: OData/odata.net#179
The text was updated successfully, but these errors were encountered: