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

Document code gen options better like in OpenAPI Generator Docs and Missing Generated READMEs #1020

Open
scprek opened this issue Jul 31, 2024 · 1 comment

Comments

@scprek
Copy link
Contributor

scprek commented Jul 31, 2024

Feature description

Better docs on codegen options and Better generated READMEs.

Code Gen Options

In the docs there a comment about the full list of configs

Please refer to [OpenApiClientSpec](https://micronaut-projects.github.io/micronaut-gradle-plugin/latest/api/io/micronaut/gradle/openapi/OpenApiClientSpec.html) for the whole list of client configuration options.

This info is not very useful, like if I choose useAuth() what type of auth does it expect, what dependencies am I required to add cc micronaut-projects/micronaut-openapi#1665

Like this outdated? I'm assuming page. Does anyone use the official micronaut client/server gens in OpenAPI tools still?
https://openapi-generator.tech/docs/generators/java-micronaut-client

User Guides

In my case the "Api Guides" section leads to a file that does not exist and Auth methods section leads to a file with only 2 headers.

Auth Guide

  • Is there any documentation on which micronaut.security things are needed? I Don't use oauth2, but it appears i MUST add it implementation(mn.micronaut.security.oauth2) to compile.
    implementation(mn.micronaut.security.oauth2)
  • When I use reactor=false the Auth Filter still uses reactor, so need to have that dependency.
    implementation(mn.micronaut.reactor)

Resulting AuthorizationFilter Class

import io.micronaut.context.BeanContext
import io.micronaut.core.annotation.NonNull
import io.micronaut.core.annotation.Nullable
import io.micronaut.http.HttpRequest
import io.micronaut.http.HttpResponse
import io.micronaut.http.MutableHttpRequest
import io.micronaut.http.annotation.Filter
import io.micronaut.http.filter.ClientFilterChain
import io.micronaut.http.filter.HttpClientFilter
import io.micronaut.inject.qualifiers.Qualifiers
import io.micronaut.security.oauth2.client.clientcredentials.ClientCredentialsClient
import io.micronaut.security.oauth2.client.clientcredentials.ClientCredentialsConfiguration
import io.micronaut.security.oauth2.client.clientcredentials.propagation.ClientCredentialsHttpClientFilter
import io.micronaut.security.oauth2.client.clientcredentials.propagation.ClientCredentialsTokenPropagator
import io.micronaut.security.oauth2.configuration.OauthClientConfiguration
import org.openapitools.auth.configuration.ConfigurableAuthorization
import org.reactivestreams.Publisher
import org.slf4j.LoggerFactory
import reactor.core.publisher.Flux
import reactor.core.publisher.Mono
import java.util.stream.Collectors
import java.util.stream.Stream
import jakarta.annotation.Generated

@Generated("io.micronaut.openapi.generator.KotlinMicronautClientCodegen")
@Filter(Filter.MATCH_ALL_PATTERN)
open class AuthorizationFilter(
@scprek scprek changed the title Document code gen options better like in OpenAPI Generator Docs Document code gen options better like in OpenAPI Generator Docs and improve READMEs Jul 31, 2024
@scprek scprek changed the title Document code gen options better like in OpenAPI Generator Docs and improve READMEs Document code gen options better like in OpenAPI Generator Docs and Missing Generated READMEs Jul 31, 2024
@altro3
Copy link
Contributor

altro3 commented Aug 23, 2024

@scprek you can fix it yourself. You now have real experience using this generator, and you can describe the documentation more accurately than, for example, I can.

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

No branches or pull requests

2 participants