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

SwaggerApiBuilder & TypeVariable #142

Closed
evernat opened this issue Oct 10, 2019 · 4 comments
Closed

SwaggerApiBuilder & TypeVariable #142

evernat opened this issue Oct 10, 2019 · 4 comments

Comments

@evernat
Copy link
Contributor

evernat commented Oct 10, 2019

Dans SwaggerApiBuilder, certains projets ajoutent
&& !(((ParameterizedType) type).getActualTypeArguments()[0] instanceof TypeVariable<?>)
après && !(((ParameterizedType) type).getActualTypeArguments()[0] instanceof WildcardType).

La raison indiquée est :

Correction vertigo qui a du mal sur les types paramétrés pour la construction de la swagger API.

@NPi2Loup
Copy link
Contributor

Please provided an use case or a description of your issue.

@evernat
Copy link
Contributor Author

evernat commented Oct 15, 2019

Je ne suis pas certain mais il s'agit peut-être de la méthode suivante (avec les fichiers joints) :

public class IndexSearchWebServices implements WebServices {
        /**
         * Effectue une recherche dans l'index ES.
         *
         * @param top nombre max d'éléments.
         * @param sortFieldName nom du champ sur lequel trier.
         * @param sortDesc sens de tri descendant ou non.
         * @param skip nombre de résultats à passer.
         * @param searchCriteria critère de recherche.
         * @param facet facettes selectionnées.
         * @param clusteringFacetName groupes de facette.
         *
         * @return le résultat.
         */
        @POST("/search")
        @AnonymousAccessAllowed
        public CustomFacetedQueryResult search(
                        @QueryParam("top") final Integer top,
                        @QueryParam("sortFieldName") final String sortFieldName,
                        @QueryParam("sortDesc") final boolean sortDesc,
                        @QueryParam("skip") final int skip,
                        @InnerBodyParam("criteria") final Map<String, Object> searchCriteria,
                        @InnerBodyParam("facets") final UiSelectedFacets facet,
                        @InnerBodyParam("group") final String clusteringFacetName) {
...
        }
}

CustomFacet.txt
CustomFacetedQueryResult.txt

@evernat
Copy link
Contributor Author

evernat commented Oct 15, 2019

Il y a sûrement plus simple pour des TypeVariable. On peut essayer avec un code du genre :

@POST("/test")
public <T extends Number> void test(T from, T to) {
...
}

NPi2Loup pushed a commit that referenced this issue Oct 15, 2019
@NPi2Loup NPi2Loup removed the invalid label Oct 15, 2019
@NPi2Loup
Copy link
Contributor

Thanks for your tes case.
We fixed how we check supported parameterizedType; Your cas should work.

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