Replies: 2 comments
-
It would have been nice if there was an example about how to use noopDatastore beans. However, I've managed to get this case working by implementing noopDatastore (basically which does nothing, does not interact with database),. |
Beta Was this translation helpful? Give feedback.
-
The NOOP data store allows pure computation endpoints. For example, imagine an endpoint that signs a document. You POST the document to Elide and Elide returns a digital signature of the document. There is no need for persistence here. There is also no need to support GET, PATCH, or DELETE HTTP requests. The elide model represents the content the client uploads in the POST. All of the logic is implemented in lifecycle hooks. The data store does nothing in this case - so you can register the NooP store as the store which handles this model. Hope that helps explain the purpose. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I've a model bean which I want to expose as a API, this model bean does not have any datastore interaction.
The below bean class (has a field/property i.e. List) which should be exposed as API data which does not have any database interaction.
Example java class:
@include(name = "terms")
@Getter
@Setter
public class Terms implements Serializable {
@ComputedAttribute
public List getTerms() {
return Arrays.stream(DeliveryTermTypes.values()).map(DeliveryTermTypes::getValue).collect(Collectors.toList());
}
}
I tried to make a API request : http://localhost:80/terms - below error is returned.
{ "errors": [ { "code": "server_internal", "detail": "InvalidCollectionException: Unknown collection terms\r\n", "title": "Unknown collection deliveryterms", "status": "500" } ] }
I've added noop datastore to the class path. Could you please give me an example case to use the noop datastore?
OR Can you suggest me the solution to expose below bean class that's not a database entity?
Beta Was this translation helpful? Give feedback.
All reactions