This works for me:)
along with the above changes need to add one more change as below:
springdoc: api-docs: path: /open-api.json
This will make swagger to pick the json file from /open-api.json as custom path instead of /v3/api-docs