Skip to content

wheels generate api-resource leaves unresolved template placeholders in generated controller #2468

@zainforbjs

Description

@zainforbjs

Describe the bug
Running the wheels generate api-resource command generates a controller containing unresolved template placeholders such as:

#objectNamePlural#
#objectNameSingular#

These placeholders are written directly into the generated CFML code instead of being interpolated during generation.
As a result, the generated API controller is not production-ready and contains invalid/incomplete code.

To Reproduce
Steps to reproduce the behavior:

  1. Run:
wheels generate api-resource Product name price:decimal sku:string
  1. Open the generated controller
  2. Observe unresolved placeholders in comments, variables, and render calls

Generated code (problematic examples):

/**
 * GET /#objectNamePlural#
 * Returns a list of all #objectNamePlural#
 */
local.#objectNamePlural# = model("product").findAll();
renderWith(data={ #objectNamePlural#=local.#objectNamePlural# });

Expected behavior
The generator should replace placeholders with actual values during template generation.
For example:

/**
 * GET /products
 * Returns a list of all products
 */
local.products = model("product").findAll();
renderWith(data={ products=local.products });

Actual behavior

  • Template variables remain unresolved in generated output
  • Generated controller contains invalid/incomplete CFML
  • Manual cleanup is required before the controller can be used

Screenshots
Image

Desktop:

  • OS: Any

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions