liferay-rest-builder

Generate REST and GraphQL API scaffolding from OpenAPI specifications for Liferay modules.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/JoaoPedroAmaral/backBarbearia --skill liferay-rest-builder
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: liferay-rest-builder
Source: https://github.com/JoaoPedroAmaral/backBarbearia/tree/main/.claude/skills/liferay-rest-builder
Command: npx skills add https://github.com/JoaoPedroAmaral/backBarbearia --skill liferay-rest-builder

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Liferay REST Builder eliminates the repetitive and error-prone work of hand-coding REST and GraphQL endpoints by generating API interfaces, DTOs, JAX-RS applications, and scaffolding that you implement in ResourceImpl classes, enabling faster, consistent headless API delivery.

Core Features & Use Cases

  • Code generation from OpenAPI: Produce headless-api interfaces, DTO classes, and implementation scaffolding from a rest-openapi.yaml specification.
  • Simultaneous REST and GraphQL output: Generate both JAX-RS resources and GraphQL endpoints from the same schema to keep APIs consistent.
  • Implementation best-practice enforcement: Directs business logic into ResourceImpl classes and prevents editing regenerated Base* files to avoid regressions.
  • Use Case: Scaffold a Foo entity with paginated GET, POST, PUT, and DELETE endpoints, implement persistence in FooResourceImpl, and deploy the module to Liferay.

Quick Start

Run the REST Builder buildREST task in the implementation module to generate headless-api and headless-impl scaffolding and then implement your business logic inside the generated ResourceImpl classes.

Frequently Asked Questions about liferay-rest-builder

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Liferay headless APIs from an OpenAPI specification?

To generate Liferay headless APIs from an OpenAPI specification, run the REST Builder buildREST Gradle task in your implementation module to scaffold headless-api and headless-impl components, DTOs, and JAX-RS resources from your rest-openapi.yaml file.

What does Liferay REST Builder generate from a rest-openapi.yaml file?

Liferay REST Builder generates headless-api interfaces, DTO classes, JAX-RS applications, and implementation scaffolding from a rest-openapi.yaml file to eliminate repetitive hand-coding for REST and GraphQL endpoints.

Can I generate both REST and GraphQL endpoints from the same OpenAPI schema for Liferay?

Yes, Liferay REST Builder simultaneously generates both JAX-RS resources and GraphQL endpoints from the same OpenAPI schema to ensure consistent headless API delivery across protocols.

Where should I implement business logic when scaffolding Liferay headless APIs?

You should implement business logic exclusively in generated ResourceImpl classes. Liferay REST Builder enforces best practices by preventing edits to regenerated Base* files to avoid regressions in the generated API scaffolding.

What configuration files are required to scaffold a custom entity API in Liferay?

Scaffolding a custom entity API in Liferay requires meeting rest-config.yaml and rest-openapi.yaml configuration requirements to properly generate DTOs, JAX-RS resources, and GraphQL endpoints for your modules.

Is hand-coding JAX-RS resources the best way to build Liferay headless APIs?

Generating JAX-RS resources from OpenAPI specifications is preferable to hand-coding Liferay headless APIs, as it eliminates repetitive and error-prone work while ensuring faster and consistent API scaffolding across modules.