bbende commented on a change in pull request #5743: URL: https://github.com/apache/nifi/pull/5743#discussion_r806105957
########## File path: nifi-registry/nifi-registry-core/nifi-registry-web-api/src/main/java/org/apache/nifi/registry/web/api/VersionResource.java ########## @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.registry.web.api; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.Authorization; +import org.apache.nifi.registry.NiFiRegistryApiApplication; +import org.apache.nifi.registry.RegistryVersion; +import org.apache.nifi.registry.event.EventService; +import org.apache.nifi.registry.web.service.ServiceFacade; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@Component +@Path("/version") +@Api( + value = "version", + description = "Retrieves the version information for this NiFi Registry.", + authorizations = { @Authorization("Authorization") } +) +public class VersionResource extends ApplicationResource { + + @Autowired + public VersionResource( + final ServiceFacade serviceFacade, + final EventService eventService) { + super(serviceFacade, eventService); + } + + @GET + @Produces(MediaType.APPLICATION_JSON) + @ApiOperation( + value = "Get version", + notes = "Gets the NiFi Registry version.", + response = RegistryVersion.class + ) + public Response getVersion() { + final String implVersion = NiFiRegistryApiApplication.class.getPackage().getImplementationVersion(); Review comment: What version is actually being returned here? We would need the Maven version like 1.16.0-SNAPSHOT. Was expecting that Maven would have to filter the version into some file that registry core can read from. ########## File path: nifi-registry/nifi-registry-core/nifi-registry-web-api/src/main/java/org/apache/nifi/registry/web/api/VersionResource.java ########## @@ -0,0 +1,63 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.registry.web.api; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.Authorization; +import org.apache.nifi.registry.NiFiRegistryApiApplication; +import org.apache.nifi.registry.RegistryVersion; +import org.apache.nifi.registry.event.EventService; +import org.apache.nifi.registry.web.service.ServiceFacade; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; + +@Component +@Path("/version") +@Api( + value = "version", + description = "Retrieves the version information for this NiFi Registry.", + authorizations = { @Authorization("Authorization") } +) +public class VersionResource extends ApplicationResource { Review comment: What do you think about calling this AboutResource? and the object being returned could be AboutInfo (or something)? My thought was the using the word "version" could be a little confusing since registry is all about version control, but this doesn't have anything to do with that aspect. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
