79771074

Date: 2025-09-21 20:17:21
Score: 1
Natty:
Report link

Thanks to Tom Cools' suggestion, I found out how to do it. In the resource class:

        @Inject
        private ConstraintMetaModel constraintMetaModel;

        @GET
        @Path("constraints")
        @Produces(MediaType.APPLICATION_JSON)
        public Collection<String> listConstraintNames() {
                return constraintMetaModel.getConstraints().stream().map(Constraint::getConstraintRef)
                                .map(ConstraintRef::constraintName).collect(Collectors.toSet());
        }

Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: majube