[FOLIO-2948] SPIKE: Vert.x OpenAPI support PoC Created: 06/Jan/21  Updated: 26/Apr/21  Resolved: 26/Apr/21

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Task Priority: P2
Reporter: Adam Dickmeiss Assignee: Adam Dickmeiss
Resolution: Done Votes: 0
Labels: R2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Issue links:
Relates
relates to FOLIO-2793 Investigate AMF "translate" facility ... Open
Sprint: CP: sprint 105, CP: sprint 112, CP: sprint 111
Story Points: 8
Development Team: Core: Platform

 Description   

https://vertx.io/docs/vertx-web-openapi/java/



 Comments   
Comment by David Crossley [ 07/Jan/21 ]

If it helps, then there is a new "validation" facility for FOLIO CI. It does both OpenAPI OAS and RAML.
https://dev.folio.org/guides/api-lint/

Comment by David Crossley [ 07/Jan/21 ]

Regarding the linked ticket FOLIO-2793 Open for "translation". At this stage i have only done basic investigation. Not yet sure if those tools are ready.

Comment by Adam Dickmeiss [ 16/Apr/21 ]

PoC here: https://github.com/folio-org/mod-eusage-reports
 

Reusing the work of this module.. But it's a PoC for OpenAPI with that Vert.x library.
 
I took Tenant API v2 and converted it - manually - to OpenAPI.

https://github.com/folio-org/mod-eusage-reports/tree/master/src/main/resources/openapi

What surprised me the most is that OpenAPI does not support JSON schemas - at least not in the form we have it in RAML. So they'd have to be tweaked somehow.  I had hoped we could reuse them as they were .. But there's just no free ride. One problem goes away and new problems arise. 
 
Properties like id and $schema are not recognized. 

https://swagger.io/docs/specification/data-models/keywords/

Note that the problem with JSON schemas is fixed in 3.1 of OpenAPI. But most tools still only support 3.0!

API wise.. 

Using the Vert.x OpenAPI API for RMB would be a quite different approach. For this reason, I'll also look at

https://openapi-generator.tech/

 
This is also used in folio-spring-base.

 

 

Comment by Adam Dickmeiss [ 26/Apr/21 ]

PoC completed with two API generators.

Generated at Thu Feb 08 23:24:27 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.