swagger-api / swagger-api/swagger-parser
Swagger parser could not read local json files..
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 867
- Forks
- 560
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 7
Description
I am trying to use swagger parser in my Spring Boot application. Below are the steps I have followed.
- Added dependency in Pom.xml (As mentioned in https://github.com/swagger-api/swagger-parser)
- Copied the swagger-Josn template to "src/main/resources/json/"
- I tried to load the swagger_json templates in the code as below
Swagger swagger = new SwaggerParser().read("/src/main/resources/json/swagger_new.json");
When this code gets executed, the parser could not read the file.
I found that the "swagger" is null.
Could any one please let me the right way to read the json from a location.
Your support will be greatly appreciated.
Thanks in advance.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The entry point is SwaggerParser().read(...) in the Spring Boot application; begin by checking how the JSON under src/main/resources/json/ is being addressed and whether the parser receives that path. Done means the local swagger_new.json is read successfully and the Swagger object is non-null.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100