Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Marco Castigliego
    @marcocast
    ah ok
    let me know so
    btw i implented oauth token authentication with micro server and stormpath. Works like a charm :)
    John McClean
    @johnmcclean
    cool :)
    yeah, he has done it in his own service. We should add a wiki entry
    need to add jersey multi-part to the classpath
    compile 'org.glassfish.jersey.media:jersey-media-multipart:2.17'
    then create your app something like this
        new MicroserverApp(ConfigurableModule
    
                                          .builder()
    
                                          .context(“multipart-app")
    
                                          .defaultResources(Arrays.asList(MultiPartFeature.class))
    
                                          .build()).run();
    John McClean
    @johnmcclean
    so it looks like you are doing something similar - it’s probably down to the dependencies
    let me know if that works, and we can add a wiki entry
    Marco Castigliego
    @marcocast
    I saw that
    but it does not work
    John McClean
    @johnmcclean
    with this dependency? compile 'org.glassfish.jersey.media:jersey-media-multipart:2.17'
    Marco Castigliego
    @marcocast
    yes
    that dependency is already in the micro-server
    John McClean
    @johnmcclean
    what error do you get ?
    Marco Castigliego
    @marcocast
    basically if i add the .defaultResources(Arrays.asList(MultiPartFeature.class))
    then
    multipart works, but all the other json normal rest method are not supported anymore
    If i send a json request to a previous working rest service, then i get : Status
    415 Unsupported Media Type
    John McClean
    @johnmcclean
    just on that resource - or on all other resources ?
    Marco Castigliego
    @marcocast
    all
    John McClean
    @johnmcclean
    wow - let’s try Stackoverflow
    Marco Castigliego
    @marcocast
    it looks like it is overriding all the other default classes
    John McClean
    @johnmcclean
    oh hold on. let me check the code
    it should still add the other resources looking at the code. You can try adding them in manually to confirm, if you like. They are :
    JacksonFeature.class,
    ApiListingResourceJSON.class,JerseyApiDeclarationProvider.class,
    JerseyResourceListingProvider.class
    Marco Castigliego
    @marcocast
    ok let me try
    Marco Castigliego
    @marcocast
    works now
    let me test the multipart as well
    John McClean
    @johnmcclean
    ok cool - what version of Microserver are you using ?
    Marco Castigliego
    @marcocast
    59
    Ciaran Treanor
    @ciarant
    Hey all - you get your Multipart stuff working ok?
    John McClean
    @johnmcclean
    looks like there was some sort of conflict between multipart and non-multipart
    (or is should I say)
    Marco Castigliego
    @marcocast
    looks like. i m running many tests
    why not adding the MultiPartFeature.class directly in the default classes of the module class?
    John McClean
    @johnmcclean
    sure, if you have it working, submit a PR for it :)
    looks like a common enough use case
    Ciaran Treanor
    @ciarant
    Here's how we set it up
    John McClean
    @johnmcclean
    cool thanks Ciaran, I’ll take a look and forward the details on to Marco
    Marco Castigliego
    @marcocast
    Thanks guys!
    Ciaran Treanor
    @ciarant
        static List<Class> getDefaultResources() {
            List<Class> resources = new ArrayList<Class>(ConfigurableModule.builder().build().getDefaultResources());
            resources.add(MultiPartFeature.class);
    
            return resources;
        }
    John McClean
    @johnmcclean
    ah right, yes looks like we have a bug, overriding the old resources
    John McClean
    @johnmcclean
    If anyone has time : initial reactive support in Microserver : aol/micro-server#38
    PR to review :)
    tobwiens
    @tobwiens
    Hi John, I start implementing the "micro service war". Before I was looking through the code and to understand your instructions.
    John McClean
    @johnmcclean
    hi Tobias, did you get the info you need
    ?