Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
liblab is a new commercial OpenAPI client generator for various languages, including C#. While free for open-source, pricing starts at $100 per month, which provides unlimited credits. Each generation run consumes one credit. Just buying credits would make more sense for small projects, or projects in maintenance mode, but that isn't offered. I've given the C# generator a try, see my findings below.
liblab build
generates a separate project for the SDK and one for its usage. I would prefer a single (combined) project by default for simplicity. Generic support code is being generated; a public NuGet package would be easier.openapi.json
, which regenerates the sdk (like NSwag does).install.sh
doesn't run on Windows, should use PowerShell instead.required
/nullable
is better than kiota, though not entirely correct. For example, the return type ofPatchPersonAsync()
should be nullable.allOf
with discriminator does not work: the generated types do not inherit from base types. For example,TodoItemDataInResponse
should inherit fromDataInResponse
. Also, oddly named "Type_" property generated, whileType
is not a reserved keyword or member.responseHeaders
totrue
inliblab.config.json
does not work: the generated code remains the same.HttpClient
instance is created each time during construction, which isn't scalable (and doesn't respond to DNS changes when long-lived). Should useHttpClientFactory
instead.DelegatingHandler
, for example to log the HTTP requests and responses.required init
properties instead of constructor parameters. Also, the parameter order fromopenapi.json
isn't respected.Content-Type
when sending a request body.IDictionary<string, object?>?
instead ofobject?
)JsonConverter
. kiota handles it more elegantly by tracking property assignments.response.EnsureSuccessStatusCode()
isn't correct: it fails when HTTP 304 is returned (similar to Kiota throws ApiException when server returns 304 microsoft/kiota#4190).I just tested a few basics, but my conclusion so far is that liblab currently isn't usable for this project (I don't consider hand-editing generated code an option). Though I'm happy to see competition in the OpenAPI space, it seems to me that liblab doesn't yet provide the features we need.
The individual commits reflect the steps I've followed. This PR was created to share my findings, it is not intended to be merged.