REST Builder
Generates REST APIs automatically from an OpenAPI (Swagger) YAML file.
- Design-first API development (define schema before coding).
- Auto-generate CRUD endpoints for entities.
Implementation
Section titled “Implementation”Create the Module
Section titled “Create the Module”blade create -t rest-builder library-apiDefine the OpenAPI Spec
Section titled “Define the OpenAPI Spec”paths: /books: get: summary: Get all books responses: 200: description: List of books content: application/json: schema: type: array items: $ref: "#/components/schemas/Book"components: schemas: Book: type: object properties: id: type: integer title: type: stringBuild and Deploy
Section titled “Build and Deploy”Liferay auto-generates endpoints at:
http://localhost:8080/o/library-api/books
Use Cases
Section titled “Use Cases”- Rapid Prototyping: Quickly scaffold APIs.
- Standardized APIs: Enforce OpenAPI compliance.