How to add swagger.json at root of service package? - swagger

I have configured my project with swagger but when i try to access the http://10.10.10.198:8083:8083/PatientApp/services it gives me error that "Can't read swagger JSON from http://10.10.10.198:8083/PatientApp/services" how can i add swagger json in project?

Related

Swagger doesn't found the yaml file (404)

I am using swagger to show my open API YAML file, it suddenly gives me "response status is 404 /openapi.yaml" when I run the spring boot application.
Note : I can open the /api-docs/ in swagger and it shows the apis, also when I hit the swagger config URL (http://localhost:8080/api-docs/swagger-config), it gives me the below response, which include the openapi.yaml file
{"configUrl":"/api-docs/swagger-config","oauth2RedirectUrl":"http://localhost:8080/swagger-ui/oauth2-redirect.html","url":"/openapi.yaml","validatorUrl":""}
The problem happened only in my machine, other colleagues' machines work fine with the same codebase.
Deps:
org.springdoc:springdoc-openapi-ui:1.6.11
org.springdoc:springdoc-openapi-javadoc:1.6.11
org.springdoc:springdoc-openapi-data-rest:1.6.11
org.springdoc:springdoc-openapi-security:1.6.11
io.swagger:swagger-annotations:1.6.6
org.openapitools:jackson-databind-nullable:0.2.2
io.swagger.parser.v3:swagger-parser:2.0.32
org.openapi.generator version "5.4.0" // open API generator plugin

Autorest error - swagger.json' is not a valid OpenAPI 2.0 definition (expected 'swagger: 2.0')

My api is running net core 3.0 with Swashbuckle.AspNetCore 5.0.0-rc5
When I run autorest on my generated swagger.json file I get:
swagger.json is not a valid OpenAPI 2.0 definition (expected 'swagger: 2.0')
My swagger.json file does indeed say "openapi": "3.0.1".
It used to be v2.0 but since I upgraded to net core 3.0 I had to upgrade Swashbuckle which now creates the json file with v3.0.1
I ran "choco install autorest" so I should be running the latest version
If autorest doesn't support openapi3.0 there must still surely be a way to generate an openapi2.0 json file?
Followed this thread, auto rest doesn’t support latest open api yet but there are workarounds
https://github.com/Azure/autorest/issues/2680
You can do this:
app.UseSwagger(o => o.SerializeAsV2 = true);

GraphQL schema file should contain a valid GraphQL introspection query result

I have successfully installed Apollo in my project and i have successfully downloaded schema.json from my endPoint. After buliding my project for creating API.swift error is displayed.
The Error is GraphQL schema file should contain a valid GraphQL introspection query result
How can i fix this issue?
You must have the correct schema.json and your_query.graphql, make sure all value in your_query.graphql able in schema.json
You download your schema using the apollo CLI

Jhipster Swagger configuration

How to override Jhipster swagger configuration in a microservice project to change the /api path in the backend and update gateway Swagger UI accordingly ?
Have you tried setting default-include-pattern in swagger section of your config file (probably application.yml)?
Default setting is /api/.*. For my project I changed it to /(api|io)/.* (its a regex) to include api and io paths.
As of JHipster 7.0, the following changes were made to the backend:
swagger maven profile becomes api-docs
jhipster.swagger property becomes jhipster.api-docs
In order to enable swagger api and to change the default uri pattern I had to:
1 - Enable the maven api-docs profile
2 - Add the following property under to application.yml (replace with your api path):
jhipster:
api-docs:
default-include-pattern: /api-new-path/.*

mule 3.7 gmail connector config-with-oauth issues

I am trying to create gmail integration using the new gmail connector using config-with-oauth. I added appropriate dependencies in pom.xml, still it is failing to find the mule-gmail xsd.
mule config xml >mule xml
Pom > pom.xml
This is the > error
You need to add the connector as an inclusion on the mule maven plugin
:
<inclusion>
<groupId>org.mule.module</groupId>
<artifactId>mule-module-gmail</artifactId>
</inclusion>
And then you also need to add the oauth-callback-config
<gmail:config-with-oauth name="GMail_Connector"
consumerKey="xxx" consumerSecret="xxx" doc:name="GMail Connector">
<gmail:oauth-callback-config></gmail:oauth-callback-config>
</gmail:config-with-oauth>

Resources