OpenAPITools / OpenAPITools/openapi-generator

[REQ] [dart-dio] Further improvements to polymorphism support

Open
#13,372 5 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

I made this issue to track what improvements can be introduced to the newly added polymorphism support for dart-dio https://github.com/OpenAPITools/openapi-generator/pull/12295
Suggestions and help are welcome !

  • Merge all test schemas into one test schema for better maintainability
    • modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml
    • modules/openapi-generator/src/test/resources/3_0/oneOf_primitive.yaml
    • modules/openapi-generator/src/test/resources/3_0/oneOf.yaml
    • should be merged with: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
    • into a new test schema specific for dart
  • Add polymorphism support to json_serializable
  • Add a new QoL method inside generated classes called createConcreteBuilder for built_value serializer
    • so for example if you have class Apple, the signature would be:
      static AppleBuilder createConcreteBuilder() => AppleBuilder();
    • if you have class Fruit which class Apple inherits from, it would have the signature:
      static $FruitBuilder createConcreteBuilder() => $FruitBuilder();
  • Implement MonoRepo structure for https://github.com/Bdaya-Dev/dart-oneof and write CD to auto deploy the package to pub.dev on each new release
  • Auto assign discriminator type on serialization based on type (PR https://github.com/OpenAPITools/openapi-generator/pull/14291)
    @kuhnroyal @agilob @jaumard @josh-burton @amondnet @sbu-WBT @banool

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.

Research direction

Review the dart-dio polymorphism support introduced by PR #12295 and the listed schemas under modules/openapi-generator/src/test/resources/3_0/. Choose one unchecked item and first run the related dart-dio tests, if available. Done means the selected improvement is implemented with updated schema or generated-code coverage; the issue does not define a single acceptance scope for all items.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.