DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library
Core Badge
Avatar

Raghuraman Ramaswamy

DZone Core CORE

Technical Architect at Accionlabs

Bangalore, IN

Joined Nov 2018

https://teq-niq.github.io/

Stats

Reputation: 846
Pageviews: 413.9K
Articles: 9
Comments: 25
  • Articles
  • Comments

Articles

article thumbnail
Swagger UI in a BFF World: Making Swagger UI Work Natively With BFF Architectures
This article introduces a Swagger UI plugin that integrates natively with BFFs using the Swagger UI extension mechanism.
February 24, 2026
· 1,915 Views · 2 Likes
article thumbnail
Logging MCP Protocol When Using stdio, Part II
Learn different ways to log the MCP JSON protocol over stdio, with an intro to MCP and a deep dive into its key components and their nuances.
August 18, 2025
· 3,291 Views · 5 Likes
article thumbnail
Logging MCP Protocol When Using stdio, Part I
Learn different ways to log the MCP JSON protocol over stdio, with an intro to MCP and a deep dive into its key components and their nuances.
August 18, 2025
· 3,498 Views · 6 Likes
article thumbnail
Extending Swagger and Springdoc Open API
Learn how to use Swagger schema extensions, and document additional constraints that would otherwise remain undocumented, including custom validators.
Updated April 17, 2024
· 53,727 Views · 15 Likes
article thumbnail
Doing More With Springdoc OpenAPI
Learn how to render fully qualified names in the generated Swagger documentation and global exception handling using Controller Advice.
Updated April 17, 2024
· 112,585 Views · 26 Likes
article thumbnail
OpenAPI 3 Documentation With Spring Boot
In this tutorial, try out a Spring Boot Open API 3-enabled REST project and explore some of its capabilities.
Updated April 17, 2024
· 119,603 Views · 16 Likes
article thumbnail
Using Swagger for Creating a PingFederate Admin API Java Wrapper
Get started with PingFederate by exploring a side utility and two sample applications that demonstrate Authorization Code Flow.
March 27, 2023
· 6,770 Views · 6 Likes
article thumbnail
Simplified Spring Swagger
Learn more about using Spring Boot Swagger-enabled REST projects.
Updated April 14, 2020
· 80,983 Views · 41 Likes
article thumbnail
Doing More With Swagger and Spring
Learn more about Spring and Swagger using the "spring-swagger-simplified" artifact.
August 8, 2019
· 31,557 Views · 16 Likes

Comments

OpenAPI 3 Documentation With Spring Boot

Apr 29, 2024 · Raghuraman Ramaswamy

Currently there are two well known strategies. Design first and Code first. Both have pros and cons and both have earned their place. There is no absolute stand on which is better. Its a long debate. I have tried both extensively and even variations- story for another time. What I would recommend is try everything and use what you feel is best for your purpose. Since you like design first have a look at my article on ping federate too. And thanks.

My Final Take On Gradle (vs Maven)

Aug 17, 2023 · Nicolas Fränkel

I too am a fan of Maven. I am also a fan of Ant. I have used Gradle. Its definitely harder to get right with it sometimes. For most projects I will certainly prefer Maven. If in a project I need both maven and some additional setup automation for example will use ant. (Ansible anyone?) But its in that scenario if I need to use Maven and lots of ant targets manually and give them to developers for running them step by step one by one. In that one scenario I would prefer gradle with Ant. The users can use gradle as the single interface and get the setup steps as well as the project build done even though under the hood both gradle and ant are used.

Format Preserving Encryption

May 25, 2023 · Hemant Mandge

Nice useful article.

Kotlin Is More Fun Than Java And This Is a Big Deal

Jan 12, 2023 · Jasper Sprengers

Liked your style. Very Eloquent.

Extending Swagger and Springdoc Open API

Oct 08, 2021 · Raghuraman Ramaswamy

Hi Malte,

Am glad the article was of some help.


Not sure what you meant by "Resolver is called multiple times with and without a parent Schema ".

Are you referring to applyBeanValidatorAnnotations method in CustomOpenApiValidator extends ModelResolver {}.

Its just a method where in its parent class - super method -you will see how the standard validator annotations have been similarly queried and added to swagger documentation for each property.

In my demo I do the same thing using same derived method. Just using swagger schema extensions to convey the constraints because the base method and existing means allow only so much.

I hope therefore you will agree the method has been used in a manner consistent with its original intent and demonstrated the purpose of my article..


Raghu


Extending Swagger and Springdoc Open API

Oct 07, 2021 · Raghuraman Ramaswamy

Hi,

Thanks for the comment. Undoubtedly there are multiple ways to achieve this.

Main point that I am showing here is how other validation annotations including custom annotations - which springdoc/swagger cannot be even aware of - can be queried to create tighter contracts and communicate the constraints more thoroughly using swagger schema extensions.

I would encourage the readers to explore every extensibility offered by springdoc and swagger.

Edit added later: On my part I have tried to use the appropriate API methods according to its original intent.

Raghu

OpenAPI 3 Documentation With Spring Boot

May 19, 2020 · Raghuraman Ramaswamy

You are right that I did not use the SpringDoc maven plugin because its not needed for the purpose of this article. There are a few other topics including the spring doc maven plugin and its proper usage- I will try writing about them in future.

Doing More With Springdoc OpenAPI

May 06, 2020 · Raghuraman Ramaswamy

Cors is for say angular or other ui applications that might be invoking your java back end -assuming the ui application and back-end are separate applications. Cors is not for swagger ui -assuming its getting generated from the back end application.

What you probably need is to configure appropriate access for the swagger urls.

Maybe you can use this for starting point:

http.authorizeRequests().antMatchers("/swagger-ui.html","/swagger-ui/**", "/v3/**" ).permitAll();

Also keep in mind sequencing of these commands is important assuming there are other such configurations.

Doing More With Springdoc OpenAPI

May 06, 2020 · Raghuraman Ramaswamy

OK. Thought it was something you needed to figure out. Great.

Doing More With Springdoc OpenAPI

Apr 30, 2020 · Raghuraman Ramaswamy

Hope you are using the new

<dependency>

<groupId>org.springdoc</groupId>

<artifactId>springdoc-openapi-ui</artifactId>

<version>1.3.6</version>

</dependency>

If so the message will be corresponding to HttpStatus code.

In the controller advice method ensure the @ResponseStatus(code) matches what you are returning in ResponseEntity() in the controller advice method.

Do not populate ResponseStatus's reason attribute. Its been know to cause problems.

Beyond that bunch of generic advice see if for any reason the controller advice method is getting skipped. What is the actual exception in the logs. A little debugging will be needed. Do you need a new handler method based on what you see in the logs. Is some other handler handling the exception.


Doing More With Springdoc OpenAPI

Apr 30, 2020 · Raghuraman Ramaswamy

I will be a bit more specific. There are some standard i would call them framework exceptions. You can find them referred in for example org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler. You could choose to handle as many of those that you encounter. Anything that you have not handled and thereby mapped appropriately to a status code other than 500 is a candidate for internal server error. That's why I chose Throwable for 500. Point is no one can predict what exception will be encountered in a method. Any unchecked exceptions is possible maybe due to bad code or maybe database down or network. As long as the framework exceptions are handled specifically everything else is a candidate for 500. But its really upto you how you design it.

Doing More With Springdoc OpenAPI

Apr 30, 2020 · Raghuraman Ramaswamy

Hi Simon,

I personally think that should change eventually. But not immediately.

I do understand from the springdoc openapi folks that they already support @QueryDslPredicate, spring-hateoas and Pageable ..

There is still more work to support: @RepositoryRestResource and the other spring-data-rest. Right now focus is on the core functionalities.

Raghu

Doing More With Springdoc OpenAPI

Apr 30, 2020 · Raghuraman Ramaswamy

You are right. That is sample GlobalControllerAdvice is given as what you can use for a starting point. You should add more specific method handlers based on what you encounter. You might also want to Create your own Problem and ErrorMessage classes with more details

Doing More With Springdoc OpenAPI

Apr 30, 2020 · Raghuraman Ramaswamy

I almost missed your message.

Try calling this from suitable placein the code

SpringDocUtils.getConfig().addResponseWrapperToIgnore(Problem.class);

SpringDocUtils.getConfig().addResponseWrapperToIgnore(ErrorMessage.class);

But personally I prefer including such classes and conveying clearly what is expected

Doing More With Springdoc OpenAPI

Apr 29, 2020 · Raghuraman Ramaswamy

Thanks for the kind words. I am just trying to learn myself and help as much as I could

Doing More With Springdoc OpenAPI

Apr 26, 2020 · Raghuraman Ramaswamy

You can use this -https://github.com/teq-niq/sample/tree/springdoc-openapi-doingmore

branch name- springdoc-openapi-doingmore

git clone url-https://github.com/teq-niq/sample.git

Follow the Readme

I will tomorrow have it mentioned inside the article. Dont want to disturb the Editors on a Sunday.

Doing More With Springdoc OpenAPI

Apr 26, 2020 · Raghuraman Ramaswamy

Don't know why the line numbers are interfering. Will check with the editors.

Meanwhile I have Noted what you said. will do it. Give me some time.

Will update a git repository url for sample code. Thanks.

Doing More With Springdoc OpenAPI

Apr 26, 2020 · Raghuraman Ramaswamy

You mean for my sample code-Currently haven't provided it. Will do that after some time. However if you copy paste carefully it should work.

OpenAPI 3 Documentation With Spring Boot

Apr 26, 2020 · Raghuraman Ramaswamy

Great. Hope you like it.

OpenAPI 3 Documentation With Spring Boot

Apr 26, 2020 · Raghuraman Ramaswamy

I am unable to see the image. If you describe the problem it might help.

Also dont forget to go through part II- https://dzone.com/articles/doing-more-with-springdoc-openapi . There will be a part III also

Doing More With Springdoc OpenAPI

Apr 25, 2020 · Raghuraman Ramaswamy

Pls clone from here -- https://github.com/springdoc/springdoc-openapi.git

Once again thanks for pointing it out. You can also use the issue tracker for suggesting any improvements.


Doing More With Springdoc OpenAPI

Apr 25, 2020 · Raghuraman Ramaswamy

Yes. Lots of fixes, improvements are in pipeline and include the bug you pointed out. As I said earlier do feel free to clone from master branch (where your bug is fixed already )while we wait eagerly for the next release.

Doing More With Springdoc OpenAPI

Apr 25, 2020 · Raghuraman Ramaswamy

When I say it will be out in next release it basically means that the change has been done and is there in the master branch which usually is a snapshot. When a release happens it will be available through maven central. You can always clone from git and use the fix if in a hurry.

Doing More With Springdoc OpenAPI

Apr 25, 2020 · Raghuraman Ramaswamy

Shalini, Thats a very good catch. It will be out in next release.

Thanks for pointing it out

Simplified Spring Swagger

Apr 09, 2019 · Raghuraman Ramaswamy

Hi,


1. I am using the dependencies as shown in https://spring.io/guides/gs/rest-service/ and https://www.baeldung.com/swagger-2-documentation-for-spring-rest-api.

2. About @ApiModelProperty noted will make @ApiXX available soon. It was in my pipeline. (Update: Its been available in last few versions of the maven jar. Also note: Some attributes of the various @ApiXX are ignored by springfox and simplified-spring-swagger because they can be supreflous and not needed)

Meanwhile I hope you liked the part where I show how to automatically leverage the validation constraints and show in the swagger documentation and swagger ui.


Do please visit https://bitbucket.org/tek-nik/simplified-swagger-examples/src/master/ and try out the examples.

Hope you find some of it useful.

Thanks.


Raghu

User has been successfully modified

Failed to modify user

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook