can t find swagger
trying to use swagger but it doesn t work
168 Replies
⌛
This post has been reserved for your question.
Hey @Timo! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.

Why do you expect it to work? How did you set it up? What is the exact response you are getting?
i expect this path to work added the depency and this:

Which dependency?
and what is that?
server.servlet.context-path=/api
could this be the problem
then I think the path would be
/api/swagger-ui


no still won t find it
try swagger-ui.html
maybe you are using some old version
show the dependencies for swagger


yea thats your address
normally don t have this
need to login to acces it but it is in a public path?
maybe you need to add with the /api prefix
added that

then theres something wrong with your jwt config ig
or security config
can you disable it
for a second


so yeah
What happens with that?
dont you need to like
security for register and login
compare the request url
instead of the whole object
try

lol
interesting
daniel you know what would be handy?
What exactly happens now when you access the URL?

seems to be some problem with jwt setup
doesnt ignore endpoints with permitall or something
Can you show your
JWTFilter
?
as text in a code block ideallyfor me the should not filter method is wrong
ah you already did
AntPathRequestMatcher#matches
accepts the HttpServletRequest
though AntPathRequestMatcher
is deprecated for removal in favor of PathPatternRequestMatcher
anywayso what should i do didn t think adding a depency would be this hard lol
can you show the public urls
this but with api in front of the last 4
for testing purposes
try this
and try to access that swagger endpoint
what
its just for testing
ur gonna switch it back later


ha
i knew it
i guess you need to add /api/api-docs to public urls too
why ?
because swagger cant access it
but why api api where does the 2nd one come from?

wrong
wdym wrong
did you add api docs to public url

was alr in there\
but it says v3
and it cant access
/api/api-docs
had api first but you said api api
no
i meant that you need to add
api/api-docs
to public urls
so what should it be now then imconfused
get rid of the second api
and in public urls add
lol
like this?

yes

interesting
show the console
output
in intellij

🙃
my honest reaction
try to do mvn clean compile
you don t know?
see if that helps
dont know what
how to fix it :/
try this
never had that happen with swagger but lets see
lmao
compile java?

oh
lmao
gradle detected
no shitt
./gradlew clean buildJava

can one of those work?
if you want to do it in 2 requests then sure
first do clean then compilejava
don t think it is gonna help tho
11:02:21 pm: Execution finished 'compileJava'.
done
yea launch the app again
and go to that swagger view

yep nothing changed
:thonk:
:GnuTrolling:
in app properties did u set anything like
springdoc api docs path
check in app logs if it says anything like
starting openapi documentation
Yep
show
and check what this log says
springdoc.api-docs.path=/api-docs
then you can remove the /v3/api-docs
cuz u dont need it
type in browser this url

see what it shows

I think probably without the
/api
there
but it throws error 500
404
not 403 or 401
anyway
type that in browser
I think you have an
@ControllerAdvice
with weird constructorsor is it this
yep
then the endpoint works
but swagger is oging crazy
2025-06-26T23:10:27.783+02:00 ERROR 32596 --- [Backend NTR-Website] [nio-8080-exec-1] c.e.b.exception.ForumExceptionHandler : Unexpected error: Handler dispatch failed: java.lang.NoSuchMethodError: 'void org.springframework.web.method.ControllerAdviceBean.<init>(java.lang.Object)'
looks like version conflict tbh
or that

Can you show the whole class?
but yes check your dependencies
Pastebin
package com.example.backend.exception;import lombok.extern.slf4j.Sl...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
u know u can just paste it here
as text
lol

whats the spring version
spring boot

What's your springdoc/swagger dependency?
//swagger?
idk how gradle exactly works but maybe clean and buildjava werent enough
to rebuild target etc
the dependency that should add the swagger ui and openapi spec
this is not all?
ah didn't see the last line on mobile
so how can i fix this lmao
uhhhhh
whats the like
gradle thing
to clean target rebuild it
and refresh dependencies
alr did that :boohoo:
try updating springdoc
to 2.8.9
wich one?
the one u got at 2.5.0
so swagger?
yes
done

bruh it was retarted indeed
now try the swagger ui endpoint
that was XD
i forgot
gdhdlhkrjhelkg
whut

ok cool how can i nicely document it?
wdym nicely document

have it like this now lmaoi
on your controller you can add stuff like
i mean the tag annotation
don t understand
what
show one of your controllers
show replies controller
code

no
in code
basically
when you have a controller
i can just take the path and the example data and show that?
wdym
it generates automatically
to document it lol
here

then show the code for the controller that you got
for this cms thing
Why do you need the controller code
You wanna know the path and the expected data?
to show you how to add the description
lmao
Ok lol
This message has been formatted automatically. You can disable this using
/preferences
.ok try this
wait
the whole class
smh
package com.example.backend.controller;
import com.example.backend.services.CMSService;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/cms")
ok pookie
This message has been formatted automatically. You can disable this using
/preferences
.
try this
why tf would i change my code
to add description
duh
no need
what
daniel is asleep otherwise i would summon him and ask what tf you are talking about XD
you add this stuff
so on swagger
it generates the description automatically
thats the whole point of using swagger
lmao
you put the description in the code
try it out u will see it update on the page

yeah but that doesn t help much it is about the doc so only need the path and the input lol
wdym
you want the example request
to be populated with real data
or like whats ur
goal
to write the doc with paths and data that needs to be sent so it is done ig don t know what you are trying to add
:thonk:
so example parameters
lmao
when sending a request to backend
yes
like idk what u want to write when u mean paths and data

just this but cleaner so future devs can easily dive into the project itself
so just the description
then you add it here
in the operation annotation
either to summary or description thing
no need but whatever thank you for the help 😅
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Post Closed
This post has been closed by <@591288621345275915>.