Luis Ramírez presented on using OpenAPI extensions to integrate OSLC concepts into OpenAPI specifications. This would allow generating OSLC APIs using Swagger Codegen and providing meaningful documentation of OSLC resources and services in Swagger UI. Ramírez demonstrated using custom x- properties prefixed in an OpenAPI spec to define OSLC-specific metadata, and generating an OSLC API using Swagger Codegen. Remaining work includes incorporating the extensions into generated code and customizing Swagger UI to surface the OSLC data. Challenges include designing RDF format support in Swagger UI and a lack of OAuth 1.0a support.
1. OpenAPI Extensions for OSLC
OSLCFest 2020
Luis Ramírez, Koneksys
luis.ramirez@koneksys.com
May 19, 2020
1
2. whoami
● Software Engineer @ Koneksys
since 2019
● Experienced with web API
Technologies
● Former co-founder of SISU
Technologies
● Lesson learned: Never
underestimate integrations
2
3. OpenAPI
● Specification to describe Web
API
● Endpoints and Resources
● Format: YAML or JSON
● Originated from Swagger
3
User
definition
User
endpoints
4. Swagger
4
Swagger Codegen: Code generation for server stubs and client SDKs.
( OpenAPI - Input)
Swagger UI: API Documentation ( OpenAPI - Input)
Swagger Core: Java Annotations ( OpenAPI - Output)
Set of tools around OpenAPI
20. Demo: OSLC OpenAPI Extensions Swagger Codegen
● Input: OpenAPI spec file with extensions
● Output: OSLC API
● API First Approach
● Swagger tools have a degree of customization
● Swagger Codegen: Mustache template overrides for generators
○ Generator: JAX-RS Server
○ Output: Spring Boot
20
Swagger
Codegen
OpenAPI with
Extensions
Custom templates
OSLC
API
22. Next Steps
● Swagger Codegen: Include extensions in Swagger Core Annotations in
generated code.
○ The generated code can’t produce an OpenAPI spec with the OSLC extensions.
● Formally define and document the extensions.
● Customize Swagger UI (plugin) to show meaningful OSLC data based on
extensions.
● Potentially generate OSLC Clients.
22
23. Major Challenges
● Swagger UI: Design support for RDF formats in samples.
● No support for OAuth 1.0a.
23
24. Open invitation to collaborate!
https://github.com/cenobyte321/oslc_openapi_extensions
Questions?
luis.ramirez@koneksys.com