Add Builder to simplify openapi document object construction

Open
#673 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp, openapi

Research direction

The issue names no files, tests, or entry points. Start by reviewing the existing OpenAPI document object model and current construction patterns, then clarify the builder's supported operations, schemas, and servers before implementation. Done would mean an agreed builder API can construct an equivalent OpenAPI document through Build().

Written by the indexing model from the issue text.

Description

help wanted type:enhancement

A regular C# builder pattern would help a lot in many scenarios.
Building an object now is very complex...

Builder pattern is also the "de facto" in Aspnetcore.. so would make sense to expose a similar api

var openApiDocumentBuilder = new OpenApiDocumentBuilder()
     .WithServers(...)
     .WithOperation(...)
     .WithOperation(...)
     .WithSchema(...);
//... etc


var openApiDocument = openApiDocumentBuilder.Build();
     
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.