News for hackers. Stuff that matters.

wing328hk

The new Python client should be easier to use and more pythonic.

Please give it a try to see if you like it.

Show HN: Auto-Generate Python REST API Clients Using OpenAPI Generator

Hi all,We've refactored the Python client generator in OpenAPI Generator(http://github.com/openapitools/openapi-generator). To give it a try, please follow 3 simple steps below:1. Download the Java JAR: https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.3.0-SNAPSHOT/openapi-generator-cli-6.3.0-20221217.085631-50.jar2. Rename the JAR as...

( Read More... | 2 comments | on HN )
Re:Ask HN: Do you write a lot of SDKs for your APIs? on Thursday September 22, 2022 @10:27PM (#32947286)
One way is to auto-generate SDKs using OpenAPI Generator (http://github.com/openapitools/openapi-generator) given an OpenAPI spec.
Re:Crystal Programming Language on Thursday September 01, 2022 @11:04PM (#32686123)
If you want to generate a Crystal SDK for REST APIs, please give OpenAPI Generator [1] a try. Here are 3 simple steps to do so: https://forum.crystal-lang.org/t/crystal-api-client-generato....

Hopefully this will save you some time in manually creating the API clients in Crystal.

[1] https://openapi-generator.tech/

Show HN: Go Echo Server Generator

Hi all,We've just added a Go Echo server generator [1] to the openapi-generator project [2].Please give it a try by following 3 simple steps below:1. Download the Java JAR: https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.1.1-SNAPSHOT/openapi-generator-cli-5.1.1-20210421.135227-116.jar2. Rename the JAR as "openapi-generator-cli.jar"3. Execute the...

( Read More... | no comments | on HN )
Re:Ask HN: Should we waste hours writing REST API clients? on Saturday February 06, 2021 @08:00PM (#26051678)
I agree with you that some generators are less mature. For example, we just added a Crystal client generator several weeks ago and we only have tests for posting a JSON body and getting it back to verify the result. Features like oneOf, anyOf are not yet supported (of course we welcome contributions to improve the Crystal client generator).

You can use customized templates (e.g. via -t option in the CLI) to meet your unique requirements. Another tips is to use code formatter such as https://prettier.io/, eslint etc to format the auto-generated code based on the style you want.

Please open an issue via http://github.com/OpenAPITools/openapi-generator/issues/new if you need help with OpenAPI Generator.

Disclosure: I'm the top contributor to OpenAPI Generator

Re:API design is stuck in the past on Sunday November 15, 2020 @12:10AM (#25098429)
You may want to give https://apitools.dev/swagger-parser/online/ a try to validate OpenAPI (fka Swagger) files.

You can do it online without a sign up or use the API or CLI according to your preference.

Re:API design is stuck in the past on Sunday November 15, 2020 @12:02AM (#25098398)
FYI. OpenAPI Generator supports many programming languages and server-side frameworks: https://github.com/OpenAPITools/openapi-generator#overview

This is not to say it has more languages supported than Protobuf as I do not know exactly how many generators out there supporting Protobuf.

(OpenAPI Generator also comes with the generator/converter that converts OpenAPI spec documents into gRPC and protocol buffer schema files. Not sure if OpenAPI Generator is also counted as a generator for Protobuf)

Re:API design is stuck in the past on Saturday November 14, 2020 @11:57PM (#25098379)
> Does OpenAPI generate code for you? I have worked on projects that use it and didn't have any generated code, so I am assuming not...

Please give OpenAPI Generator [1] a try to generate clients, servers stubs, documentation, schemas (graphql, protobuf, etc) and more. It supports many programming languages and many companies are already using it [2]:

[1] https://github.com/OpenAPITools/openapi-generator

[2] https://openapi-generator.tech/users

(Disclosure: I'm the top contributor to OpenAPI Generator)

Show HN: Auto-Generate Scala API Clients for REST APIs

We've added a new generator to OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator) to generate Scala (sttp - https://github.com/softwaremill/sttp) API clients. To generate the client given an [OpenAPI/Swagger specification file](https://github.com/OAI/OpenAPI-Specification), please follow 3 simple steps below:1. Download the Java JAR:...

( Read More... | no comments | 4 points | on HN )
Re:Functional Programming in OCaml on Tuesday February 25, 2020 @09:19AM (#22413377)
If you want to access RESTful APIs via OCaml, you may consider using OpenAPI Generator to generate the OCaml client automatically instead of manually creating one. Here are 3 simple steps to do so:

1. Download the OpenAPI Generator CLI Java JAR (https://repo1.maven.org/maven2/org/openapitools/openapi-gene...)

2. Rename the JAR as "openapi-generator-cli.jar"

3. Run the following command to generate an OCaml API client for the Petstore API (https://raw.githubusercontent.com/OpenAPITools/openapi-gener...):

Mac/Linux:

$ java -jar openapi-generator-cli.jar generate -g ocaml -i https://raw.githubusercontent.com/OpenAPITools/openapi-gener... -o /var/tmp/ocaml/

Windows:

$ java -jar openapi-generator-cli.jar generate -g ocaml -i https://raw.githubusercontent.com/OpenAPITools/openapi-gener... -o C:\tmp\ocaml

If you've any feedback or question, please let us know via https://github.com/OpenAPITools/openapi-generator/issues/new

Re:OpenAPI 3.0.3 Specification Released on Friday February 21, 2020 @09:22AM (#22383267)
> Generators are still in need of work for the languages I use, but this is the future.

Please share your feedback by opening an issue via https://github.com/OpenAPITools/openapi-generator/issues/new.... Thanks.

Re:OpenAPI 3.0.3 Specification Released on Friday February 21, 2020 @09:18AM (#22383230)
Do you mind opening an issue via http://github.com/OpenAPITools/openapi-generator/issues/new with the details? (I assumed you've checked out the auto-generated documentation and that doesn't look good to you.)

There were discussions on type hints but unfortunately no one has found the time to make the contribution yet.

We also have a new `python-experimental` client generator that has better support for new features in OAS v3. Please check it out to see if it works better for you.

Re:OpenAPI 3.0.3 Specification Released on Friday February 21, 2020 @09:12AM (#22383186)
I would recommend the `typescript-angular` generator as a starting point for evaluation as it's pretty active and we just added Angular 9 support.
Re:OpenAPI 3.0.3 Specification Released on Friday February 21, 2020 @09:10AM (#22383172)
We just added oneOf support to the Java client generator a few weeks ago. The enhancement will be included in the upcoming 4.3.0 release. You can give it a try with the latest snapshot version for the time being.

Ref: https://github.com/OpenAPITools/openapi-generator/pull/5120

You may want to try OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator), which supports JS client/server, TS, JS Flow and many other languages for code generation.

There're many IDE plug-ins that integrate with OpenAPI Generator: https://github.com/OpenAPITools/openapi-generator#35---ide-i....

For C++, I don't think anyone has contributed the OAUTH2 enhancement to the C++ client generator (cpp-qt5, cpp-restsdk) yet. We definitely welcome the contributions.

For Java, I agree there are rooms for improvements as we cover so many different libraries (jersey2, retrofit2, openfeign, resttemplate, etc) and a good starting point is https://github.com/OpenAPITools/openapi-generator/tree/maste... and we can plot the OAuth-related enhancements back to the template more easily.

Older »