kbss-cvut / fta-fmea

GNU General Public License v3.0
3 stars 1 forks source link

Document one REST endpoint with springdoc #82 #150

Open palagdan opened 3 weeks ago

palagdan commented 3 weeks ago

Resolves #82 if you like this style of documentation, I can document the other endpoints in the current ticket.

palagdan commented 5 days ago

@blcham

I'm currently blocked by this ticket. I've spent a lot of time trying to figure out why I can't access the generated Springdoc when using internal authorization via an Nginx deployment.

When I make a direct request to the backend running locally, I receive the correct API documentation. As you can see from the screenshots, the URLs are identical, and Nginx should be proxying the same path.

Nginx deployment (Springdoc not generated):

Screenshot from 2024-09-11 08-39-08

Local backend (API doc available): Screenshot from 2024-09-11 08-53-53

Also I am not sure about this annotation:

@Operation(security = {@SecurityRequirement(name = "bearer-key")

If we are using internal authorization, accessing the Springdoc should only require a session ID to pass the security filter. Bearer tokens are only necessary when OAuth is in use.