OpenAPI spec fails validation

Description

I had tried importing the openapi.json into an API tool, but was getting messages that the format was incorrect. Running against a validator, the following error was returned:

After manually adding "version":"1.0.0", within the "info" section, I was able to import into my API tool but the validator showed a new error:

Acceptance / Success Criteria

None

related to

Lucidchart Diagrams

Activity

Jane Hou July 26, 2021 at 4:47 PM
Edited

I checked the rest of the warnings, they all complain about the same thing(operationIds not unique, path parameter missing in POST definition). They all happen in the AbstractDaoRestServiceWithDTO.java . Like I mentioned in the above comment, this is due to our older code structure that mix Rest API code with business logic code. To fix this, we need to refactor the design of this part of the code which seems out of the scope at the point. I think the new API server that we are planning to work on already has a plan to handle Swagger/OpenAPI stuff properly base on the 2 hours Rest API intro session on Tuesday last week.

Jane Hou July 15, 2021 at 2:31 PM

. No. I only fixed the "version" part. There are still many other warnings that we can't do anything about it right now because most of the OpenAPI doc are auto-generated from our existing RESTful API code written years ago. To solve this completely, we need to refactor the structure of our older code to add annotation to it. But obviously, the team doesn't have plan to do this for now because this will include much effort to test all v2 restful API. All newer RESTful API code written this year has OpenAPI annotation. I'll spend some time next sprint to check if there is anywhere else that we can add annotation without changing the original code to at least reduce some numbers of the warning, then we can close this Jira.

Jane Hou June 17, 2021 at 5:21 PM

Pull request for adding "version" to "info" section.

https://github.com/OpenNMS/opennms/pull/3484

 

Mark Mahacek June 10, 2021 at 5:58 PM

Initially I had tried importing into Postman, and that failed. The message in the ticket came from https://apitools.dev/swagger-parser/online/

Fixed

Details

Assignee

Reporter

HB Grooming Date

HB Backlog Status

Sprint

Fix versions

Affects versions

Priority

PagerDuty

Created June 4, 2021 at 11:43 PM
Updated June 15, 2022 at 12:42 AM
Resolved July 26, 2021 at 4:47 PM