Expose formula expression in api resource
This commit is contained in:
@@ -19,4 +19,10 @@ class FormulaApiResource
|
||||
{
|
||||
#[API\ApiProperty(identifier: true, writable: false)]
|
||||
public string $name;
|
||||
|
||||
/**
|
||||
* The underlying math expressed as a common-notation formula.
|
||||
*/
|
||||
#[API\ApiProperty(writable: false)]
|
||||
public string $expression;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ class FormulaStateProvider implements ProviderInterface
|
||||
{
|
||||
$resource = new FormulaApiResource();
|
||||
$resource->name = $formula::getName();
|
||||
$resource->expression = $formula::getAsExpression();
|
||||
|
||||
return $resource;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user