@Override
    public void process(Request request, TreeNode<Resource> resultNode, String href) {
      if (resultNode.getObject().getType() == Resource.Type.CompatibleRepositoryVersion) {
        Resource node = resultNode.getObject();
        Object id = node.getPropertyValue(REPOSITORY_VERSION_ID_PROPERTY_ID);
        Object stackVersion = node.getPropertyValue(REPOSITORY_VERSION_STACK_VERSION_PROPERTY_ID);
        if (id != null && stackVersion != null) {
          resultNode.setProperty("href", fixHref(href, id, stackVersion));
          return;
        }
      }
      super.process(request, resultNode, href);
    }
ResourceDefinition with a custom href post processor which overrides the URL
ambari-server/src/main/java/org/apache/ambari/server/api/resources/CompatibleRepositoryVersionDefinition.java