Support ability to return compact JSON format when calling SerializeAsJsonAsync

Open Beginner friendly
#2,798 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
csharp
Domain
api

Research direction

Start at OpenApiSerializableExtensions.SerializeAsJsonAsync and inspect how JSON writer settings are currently handled. Add support for the optional OpenApiJsonWriterSettings described in the issue, verify that Terse produces compact JSON, and run the existing serialization tests if available.

Written by the indexing model from the issue text.

Description

Is your feature request related to a problem? Please describe.
I would like to obtain a compact json format when calling OpenApiSerializableExtensions.SerializeAsJsonAsync

Describe the solution you'd like
That could be done by adding an optional OpenApiJsonWriterSettings parameter to the SerializeAsJsonAsync method (with Terse = true if compact format needed)

Describe alternatives you've considered
Currently i can parse and re-serialize json to obtain a minified format but it would be better to just be able to have the right format immediately.

Additional context
I'm able to propose a pull request if needed.

Dominant language
C#
Stars
1.6k
Forks
286
Avg merge
6h 38m
Merged PRs (30d)
35

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/OpenAPI.NET

All issues in microsoft/OpenAPI.NET

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.