Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect generation of a composed anyof serializer with an array in the schema #137

Open
Tetraquark opened this issue Jun 4, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@Tetraquark
Copy link
Collaborator

For scheme like this:

schema:
  anyOf:
    - type: object
      properties:
        meta:
          $ref: '#/components/schemas/PaginationMeta'
        items:
          type: array
          items:
            $ref: '#/components/schemas/NotificationCustomised'
    - type: array
      items:
        $ref: '#/components/schemas/NotificationCustomised'

Generates incorrect composed serializer with code like this:

val item1 = runCatching { json.decodeFromJsonElement(kotlin.collections.List<NotificationCustomised>.serializer(), element) }

Where wrong part is

kotlin.collections.List<NotificationCustomised>.serializer()

Should be:

ListSerializer(NotificationCustomized.serializer())
@Tetraquark Tetraquark added the bug Something isn't working label Jun 4, 2021
@H4kt
Copy link

H4kt commented May 23, 2024

Facing the same issue here
Any chance of this being fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants