Re: Using Swagger CodeGen to Generate a Client Library.

2021-11-06 Thread Petri Tuomola
I think we might actually be OK on that front: we have defined in application.properties the following: server.forward-headers-strategy=framework As far as I can see, this means that ForwardedHeaderFilter will replace the protocol, port, host etc for processing with the ones it finds in the hea

Re: Using Swagger CodeGen to Generate a Client Library.

2021-10-31 Thread Aleksandar Vidakovic
... right... that reminds me of another thing: to make the SSL configuration optional... at the moment this is hardwired in the Spring XML configuration, but I would argue in most - production - scenarios the whole SSL stuff is handled by some proxy setup... another reason to fully embrace starter

Re: Using Swagger CodeGen to Generate a Client Library.

2021-10-31 Thread Alexander Finnigan
It might be the side effect of redirecting. Its a wild guess but if you are sending POST to http://localhost:8080/fineract-provider.. you will get an http 302 to redirect your request to https://localhost:8443/fineract-provider and it became GET for some reason... Try to hit the https://localh

Re: Using Swagger CodeGen to Generate a Client Library.

2021-10-31 Thread Petri Tuomola
Thanks Alexander - that’s spot on! It seems that PUT / POST / DELETE don’t work on our HTTP (i.e. non-SSL) endpoint - they magically become GETs. When I switched to HTTPS then the requests worked fine. Seems like another thing to fix - either stop supporting HTTP altogether, or make sure tha

Re: Using Swagger CodeGen to Generate a Client Library.

2021-10-31 Thread Alexander Finnigan
It might be the side effect of redirecting. Its a wild guess but if you are sending POST to http://localhost:8080 /fineract-provider .. you will get an http 302 to redirect your request to https://localhost:8443

Re: Using Swagger CodeGen to Generate a Client Library.

2021-10-29 Thread Aleksandar Vidakovic
... great that you got it working... This GET issue is weird... my bet would be that one of the existing filters in Fineract does something funky... or maybe that we have a mix of Spring XML and Java config? ... I used the latest Jersey in a couple of projects (with Spring Boot) and don't remembe

Re: Using Swagger CodeGen to Generate a Client Library.

2021-10-29 Thread Petri Tuomola
Thanks Aleks. I actually got it working with a slightly different approach, also resolved all the class path issues etc. But now stuck with a very weird issue: Jersey receives all requests as GET, even if you send in POST / PUT / DELETE etc. I’ve tried debugging and the request is picked up by

Re: Using Swagger CodeGen to Generate a Client Library.

2021-10-26 Thread Aleksandar Vidakovic
Hi Petri, ... here's the link to the Jersey 2.x configuration: https://github.com/FITER1/fineract-ng/blob/feature/01-migration-eclipse-link/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/JerseyConfiguration.java I'm saving some typing with lines 53, 81-87 (aka get al

Re: Using Swagger CodeGen to Generate a Client Library.

2021-10-26 Thread Petri Tuomola
Sounds great! Looking forwarded to seeing your PR, and then let's work together on this. In the meantime I'll see if I can fix the rest of the issues with Jersey 2 - I fixed the API path issue, and now it would seem that most of the stuff works. On Wed, Oct 27, 2021, 02:29 Aleksandar Vidakovic w

Re: Using Swagger CodeGen to Generate a Client Library.

2021-10-26 Thread Aleksandar Vidakovic
... true, didn't have that on the radar... even simpler than portfolio clients that I had in mind... and I think with global configuration we should have a bit more freedom to experiment... Cool, let's do that. I can get to that later today or tomorrow if that works for you... opening a first draf

Re: Using Swagger CodeGen to Generate a Client Library.

2021-10-26 Thread Petri Tuomola
That makes sense - it should be safer and more conservative. We can start anywhere but my suggestion would be something that is as simple as possible, but has integration tests built for it. That way we could focus on getting the structure of the code with fineract-client / Jackson right, rathe

Re: Using Swagger CodeGen to Generate a Client Library.

2021-10-26 Thread Aleksandar Vidakovic
... the second approach sounds like a good strategy (as much as I'd like to overhaul things using the first approach)... taking things from the integration tests is a bit more conservative and makes sure to not drop anything... and in some cases we might be able to even extend the integration tests

Re: Using Swagger CodeGen to Generate a Client Library.

2021-10-25 Thread Petri Tuomola
Thanks Aleks I think this is one of the key things we should try to tackle. As Aleks states, moving to type safe REST resource classes would simplify / reduce the code by a huge amount and also mean that Swagger etc just magically work. No need to code / maintain helper resource classes etc.

Re: Using Swagger CodeGen to Generate a Client Library.

2021-10-23 Thread Aleksandar Vidakovic
Hi, ... just as a reminder: pretty much the whole REST resource classes in Fineract abandoned type safety and keeps the request JSON body in a simple string variable. That makes it pretty much impossible to extract any information about the data structures. To get around that Sanyam added manually