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

Update HelloController.kt #1491

Conversation

adrianofsp
Copy link

fix missing annotation parameter name identifier.

fix missing annotation parameter name identifier.
@CLAassistant
Copy link

CLAassistant commented Mar 21, 2024

CLA assistant check
All committers have signed the CLA.

@altro3
Copy link
Collaborator

altro3 commented Mar 21, 2024

With KSP it is work fine. It's strange why the library works correctly and the compiler doesn't complain....
изображение
изображение

But I think this solution will be better:

BEFORE:

    @Get(uri = "/greetings/{name}", produces = [MediaType.TEXT_PLAIN])
    @Operation(summary = "Greets a person", description = "A friendly greeting is returned")
    // Please Note: Repeatable Annotations with non-SOURCE retentions are not yet supported with Kotlin, so we are using `@ApiResponses`
    // instead of `@ApiResponse`, see https://youtrack.jetbrains.com/issue/KT-12794
    @ApiResponses(
            ApiResponse(content = [Content(mediaType = "text/plain", schema = Schema(type = "string"))]),
            ApiResponse(responseCode = "400", description = "Invalid Name Supplied"),
            ApiResponse(responseCode = "404", description = "Person not found")
    )
    @Tag(name = "greeting")
    open fun greetings(name: String): Mono<String> {
        return Mono.just("Hello $name, how are you doing?")
    }

AFTER:

    @Tag(name = "greeting")
    @Operation(summary = "Greets a person", description = "A friendly greeting is returned")
    @ApiResponse(content = [Content(mediaType = "text/plain", schema = Schema(type = "string"))])
    @ApiResponse(responseCode = "400", description = "Invalid Name Supplied")
    @ApiResponse(responseCode = "404", description = "Person not found")
    @Get(uri = "/greetings/{name}", produces = [MediaType.TEXT_PLAIN])
    open fun greetings(name: String): Mono<String> {
        return Mono.just("Hello $name, how are you doing?")
    }

Need to remove comment about https://youtrack.jetbrains.com/issue/KT-12794 - it's already fixed

@adrianofsp WDYT?

@adrianofsp
Copy link
Author

adrianofsp commented Mar 21, 2024 via email

@altro3
Copy link
Collaborator

altro3 commented Mar 21, 2024

Ok, I fixed this example here #1492
изображение

@altro3 altro3 closed this Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants