openapi-generator icon indicating copy to clipboard operation
openapi-generator copied to clipboard

[REQ] List of generators that will first support openapi 3.1.0 features

Open spacether opened this issue 2 years ago • 6 comments

Is your feature request related to a problem? Please describe.

This ticket is a record of which generator will first support opeanpi 3.1.0 specs and feature Note: One could track the supported features by adding features to our supported feature matrix like we see here: https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/python-experimental.md#schema-support-feature It may also be useful to run unit tests specs on generated servers/clients like python-experimental does in these 3.0.3 json schema tests. Which run on node4 here

For generators to be able to implement 3.1.0 unevaluatedProperties they need to have properties, patternProperties + additionalProperties working. Not all generators have additionalProperties working for all schema use cases. There is a java property supportsAdditionalPropertiesWithComposedSchema which indicates broader support for the addditionalProperties keyword on composition use cases (which are usually type unset=AnyType schemas) The generators which have this set to true are:

  • python-experimental
  • python
  • java

Generators

Generator Reason Included in the 3.1.0 list
python-experimental - it supports inline schemas of any depth
- it is very compliant with json schema 3.0.3 per 3.0.3 unit tests
- it already supports schema type arrays under the hood because it converts type: nullable X to type X + type null
- it is structured in a way that new validations like prefixItems/contains etc can be easily added

Please vote on Generators that you want

Please vote on generators that you want added by adding +s to the generator name in a comment.

If you want a feature, how about you write a PR adding it?

This is an open source project, so if you want a generator to support the new features please consider writing a PR adding the feature that you want. We are all volunteers here and we can all improve and contribute to this project.

spacether avatar Aug 03 '22 19:08 spacether

python (python-experimental before 6.2.0) Development of this generator is continuing in this different repo

Update: openapi v3.1.0 document ingestion is supported in the new repo and includes these new/updated keywords:

  • type (array of types or non-array value)
  • const
  • contains
  • dependentRequired
  • dependentSchemas
  • maxContains
  • minContains
  • patternProperties
  • prefixItems
  • propertyNames
  • unevaluatedItems
  • unevaluatedProperties
  • if
  • then
  • else

And > 66% of the 3.1.0 new json schema keywords have been implemented in the above repo

spacether avatar Aug 03 '22 19:08 spacether

python-flask

d-mo avatar Aug 28 '22 14:08 d-mo

java

sjacek avatar Aug 29 '22 08:08 sjacek

typescript-fetch

akhan5 avatar Aug 29 '22 11:08 akhan5

typescript-axios

nmalfroy avatar Sep 07 '22 17:09 nmalfroy

typescript-angular

jbezuk avatar Sep 20 '22 14:09 jbezuk

kotlin-spring

sam-distler avatar Nov 03 '22 18:11 sam-distler

Rust

mr-ayyagari avatar Nov 07 '22 19:11 mr-ayyagari

go

vekunz avatar Nov 08 '22 10:11 vekunz

Rust

mattoni avatar Nov 08 '22 16:11 mattoni

Ruby

ThomasKoppensteiner avatar Nov 08 '22 20:11 ThomasKoppensteiner

kotlin, typescript-angular, swift5

valentin-braun avatar Nov 16 '22 10:11 valentin-braun

Rust (Specifically rust server. I don't know how much code it shares with rust client) I am willing to put some work into it but don't really know where to get started.

bryanmehall avatar Nov 22 '22 02:11 bryanmehall

typescript-swr

hyunoosung avatar Nov 25 '22 07:11 hyunoosung

kotlin

gerak-cz avatar Jan 09 '23 07:01 gerak-cz

kotlin+s

rovkinmax avatar Feb 09 '23 08:02 rovkinmax

dart-dio

zacharypuulsedev avatar Feb 10 '23 22:02 zacharypuulsedev

csharp-netcore

doctorpangloss avatar Mar 28 '23 02:03 doctorpangloss

adoc

snowe2010 avatar Apr 26 '23 00:04 snowe2010

kotlin-server

cpoole avatar Jul 19 '23 19:07 cpoole

It’s simply goofy that the JavaScript and typescript platforms wouldn’t be a priority given that web clients are all in JavaScript.

b-jsshapiro avatar Aug 13 '23 19:08 b-jsshapiro

Kinda OFF-TOPIC, sorry:

For anyone like me who urgently needs a TS-Fetch or TS-Axios generator that's able to handle 3.1 schemas: I recently worked through the handful of available projects that fit the requirements and went with drwpow/openapi-typescript, which generates a TS-based fetch clients (one for each HTTP verb). I am not a huge fan of the resulting API (it doesn't throw errors but gives you const {data, error, response} = await GET(...); instead and you have to address your operations through the endpoint path as a string), but it works! So if you need something for the time being, it might be worth a try.
Also: For people who need an easy way to implement request/response interceptors: It's actually not that difficult to implement that in a wrapped fetch function that you can pass on to the library:

// custom, monkeypatched "fetch" for implementing request/response interceptors
const customFetch = async (input: RequestInfo | URL, init?: RequestInit | undefined) => {

  // --- request interceptors go here... ---
  // ...

  // --- perform request ---
  const response = await globalThis.fetch(input, init);

  // --- response interceptors go here... ---
  //...

  return response;
};

bkis avatar Aug 31 '23 09:08 bkis