Skip to content

Conversation

@RehanSaeed
Copy link
Contributor

The JsonSerializerSettings is available in MVC via IOptions<T> that is very easy to configure via .AddMvcCore(...).AddJsonOptions(...). So perhaps we should use it.

The second part of this PR is to indent the JSON when running in development mode for better readability.

@RehanSaeed
Copy link
Contributor Author

This PR also helps with graphql-dotnet/graphql-dotnet#662 in that MVC sets JsonSerializerSettings.DateFormatString to the correct ISO8601 value with the offset by default.

Copy link
Member

@joemcbride joemcbride left a comment

Choose a reason for hiding this comment

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

These look fine to me. Any objections @pekkah ?

@pekkah pekkah merged commit 00a67a1 into graphql-dotnet:master Jun 6, 2018
pekkah added a commit that referenced this pull request Jun 6, 2018
…d uses the MVC built in JsonSerializerSettings. (#115)"

This reverts commit 00a67a1.
pekkah added a commit that referenced this pull request Jun 6, 2018
…118)

* Revert "Revert "Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (#116)" (#117)"

This reverts commit 64a4658.

* Revert "Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (#116)"

This reverts commit a4993c8.

* Revert "Initialize the DocumentWriter so it indents in development and uses the MVC built in JsonSerializerSettings. (#115)"

This reverts commit 00a67a1.
@pekkah
Copy link
Contributor

pekkah commented Jun 6, 2018

Can you reopen against develop branch

@RehanSaeed
Copy link
Contributor Author

Moved to #121

pobisw pushed a commit to pobisw/server that referenced this pull request Dec 29, 2018
…raphql-dotnet#118)

* Revert "Revert "Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (graphql-dotnet#116)" (graphql-dotnet#117)"

This reverts commit 64a4658.

* Revert "Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (graphql-dotnet#116)"

This reverts commit a4993c8.

* Revert "Initialize the DocumentWriter so it indents in development and uses the MVC built in JsonSerializerSettings. (graphql-dotnet#115)"

This reverts commit 00a67a1.
pobisw pushed a commit to pobisw/server that referenced this pull request Dec 29, 2018
…raphql-dotnet#118)

* Revert "Revert "Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (graphql-dotnet#116)" (graphql-dotnet#117)"

This reverts commit 64a4658.

* Revert "Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (graphql-dotnet#116)"

This reverts commit a4993c8.

* Revert "Initialize the DocumentWriter so it indents in development and uses the MVC built in JsonSerializerSettings. (graphql-dotnet#115)"

This reverts commit 00a67a1.
pekkah pushed a commit that referenced this pull request Feb 14, 2019
* Initialize the DocumentWriter so it indents in development and uses the MVC built in JsonSerializerSettings. (#115)

* Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (#116)

* Revert "Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (#116)" (#117)

This reverts commit a4993c8.

* Revert "Use MVC JsonSerializerSettings & Indent JSON in Development" (#118)

* Revert "Revert "Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (#116)" (#117)"

This reverts commit 64a4658.

* Revert "Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (#116)"

This reverts commit a4993c8.

* Revert "Initialize the DocumentWriter so it indents in development and uses the MVC built in JsonSerializerSettings. (#115)"

This reverts commit 00a67a1.

* remove BoundedCapacity (defaults to Unbounded)
rose-a added a commit to rose-a/server that referenced this pull request Mar 23, 2020
* Initialize the DocumentWriter so it indents in development and uses the MVC built in JsonSerializerSettings. (graphql-dotnet#115)

* Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (graphql-dotnet#116)

* Revert "Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (graphql-dotnet#116)" (graphql-dotnet#117)

This reverts commit a4993c8.

* Revert "Use MVC JsonSerializerSettings & Indent JSON in Development" (graphql-dotnet#118)

* Revert "Revert "Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (graphql-dotnet#116)" (graphql-dotnet#117)"

This reverts commit 64a4658.

* Revert "Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (graphql-dotnet#116)"

This reverts commit a4993c8.

* Revert "Initialize the DocumentWriter so it indents in development and uses the MVC built in JsonSerializerSettings. (graphql-dotnet#115)"

This reverts commit 00a67a1.

* remove BoundedCapacity (defaults to Unbounded)
Shane32 pushed a commit that referenced this pull request Aug 31, 2020
* Initialize the DocumentWriter so it indents in development and uses the MVC built in JsonSerializerSettings. (#115)

* Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (#116)

* Revert "Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (#116)" (#117)

This reverts commit a4993c8.

* Revert "Use MVC JsonSerializerSettings & Indent JSON in Development" (#118)

* Revert "Revert "Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (#116)" (#117)"

This reverts commit 64a4658.

* Revert "Add ComplexityConfiguration, EnableMetrics, SetFieldMiddleware to GraphQLHttpOptions (#116)"

This reverts commit a4993c8.

* Revert "Initialize the DocumentWriter so it indents in development and uses the MVC built in JsonSerializerSettings. (#115)"

This reverts commit 00a67a1.

* remove BoundedCapacity (defaults to Unbounded)
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