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

Custom serializers should inherit generic types #1293

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

JaneWardSandy
Copy link
Contributor

@JaneWardSandy JaneWardSandy commented Nov 8, 2023

Generic update derived from #1276

@Get("{?pageable*}")
@ApiResponse(responseCode = "200")
suspend fun hello(pageable: Pageable): Page<String> = Page.of(listOf("Hello, World!"), pageable, 2)

interface SwaggerPage<T> {
  @get:Schema(description = "The content.") val content: List<T>
  @get:Schema(description = "The pageable for this slice.") val pageable: Pageable
}

Current the items type was object, which was lost the generic type

content:
  type: array
  description: The content.
  items:
    type: object

Expected it should be inherit the generic type if it had generics

content:
  type: array
  description: The content.
  items:
    type: string

@altro3 altro3 merged commit 2298761 into micronaut-projects:5.2.x Nov 8, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants