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

fix(docs): propose a mapKey for generated config docs of a Map config item only for config group #4715

Merged

Conversation

machi1990
Copy link
Member

Fixes #4700

/cc @gsmet can you try this fix please? thanks.

@machi1990 machi1990 requested a review from gsmet October 21, 2019 16:25
@machi1990 machi1990 force-pushed the fix/hide-map-key-for-pass-through-config branch from 368ec55 to 872a66b Compare October 22, 2019 10:31
@gsmet gsmet self-assigned this Oct 28, 2019
@gsmet
Copy link
Member

gsmet commented Oct 30, 2019

@machi1990 so I finally got to this one: I rebased and generated the doc but it doesn't work.

There are several elements with the same anchor in the KeycloakPolicyEnforcerConfig. I wonder if it's not the two maps at the bottom causing issues.

Could you have a look?

@machi1990
Copy link
Member Author

@machi1990 so I finally got to this one: I rebased and generated the doc but it doesn't work.

There are several elements with the same anchor in the KeycloakPolicyEnforcerConfig. I wonder if it's not the two maps at the bottom causing issues.

Hi Guillaume, I think we the @ConfigItem(name = ConfigItem.PARENT) parent name, the two configs will end up with parent name/key i.e quarkus.keycloak.policy-enforcer."paths".claim-information-point.

What we can try to detect this configuration and fallback to not treating the keys as passthrough - we'll have something like this quarkus.keycloak.policy-enforcer."paths".claim-information-point."complex-config" and quarkus.keycloak.policy-enforcer."paths".claim-information-point."simple-config" WDYT? @gsmet

Also, the description on the two config items could use some love. If we display the two keys just like suggested above with a proper description - what is the complex config or a simple config and when to use one or the other, an example usage will be useful.

In the meantime we have empty java docs

        @ConfigGroup
        public static class ClaimInformationPointConfig {

            /**
             *
             */
            @ConfigItem(name = ConfigItem.PARENT)
            Map<String, Map<String, Map<String, String>>> complexConfig;

            /**
             *
             */
            @ConfigItem(name = ConfigItem.PARENT)
            Map<String, Map<String, String>> simpleConfig;
        }

WDYT ? @pedroigor @sberyozkin

@gsmet
Copy link
Member

gsmet commented Oct 31, 2019

I hadn't followed this but you're right it looks very fishy.

@machi1990 machi1990 force-pushed the fix/hide-map-key-for-pass-through-config branch from 872a66b to 91c5c9b Compare October 31, 2019 12:56
@gsmet
Copy link
Member

gsmet commented Nov 1, 2019

So... the config property is OK but... the type is not. In the MongoDB case I put in the original issue, you need the type to be Map<String, String> not String as it is now.

@machi1990 machi1990 force-pushed the fix/hide-map-key-for-pass-through-config branch from 91c5c9b to 934a73b Compare November 1, 2019 18:23
@machi1990 machi1990 added the triage/needs-rebase This PR needs to be rebased first because it has merge conflicts label Nov 3, 2019
@machi1990 machi1990 force-pushed the fix/hide-map-key-for-pass-through-config branch from 934a73b to 4f3cac6 Compare November 3, 2019 19:00
@machi1990 machi1990 removed the triage/needs-rebase This PR needs to be rebased first because it has merge conflicts label Nov 3, 2019
@machi1990
Copy link
Member Author

@gsmet I just rebased with master. This one is ready for review now.

machi1990 added a commit to machi1990/quarkus-generated-extension-config-docs that referenced this pull request Nov 4, 2019
@machi1990 machi1990 force-pushed the fix/hide-map-key-for-pass-through-config branch from 4f3cac6 to 1413d0e Compare November 4, 2019 13:20
@gsmet gsmet added the backport? label Nov 4, 2019
@machi1990 machi1990 force-pushed the fix/hide-map-key-for-pass-through-config branch from 1413d0e to 4499400 Compare November 4, 2019 14:16
Copy link
Member

@gsmet gsmet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, it fixes some very important issues with doc generation so let's merge it and backport it.

@gsmet gsmet merged commit ff84cc2 into quarkusio:master Nov 4, 2019
@gsmet gsmet added this to the 0.28.1 milestone Nov 4, 2019
@gsmet gsmet removed the backport? label Nov 4, 2019
@gsmet
Copy link
Member

gsmet commented Nov 4, 2019

Thanks @machi1990 !

@machi1990 machi1990 deleted the fix/hide-map-key-for-pass-through-config branch November 4, 2019 17:17
@machi1990
Copy link
Member Author

Thanks @machi1990 !

My pleasure :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doc generation - issue with passthrough maps
2 participants