/*
 * MIT License
 *
 * Copyright (c) 2021 EPAM Systems
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package com.epam.catgenome.controller.metadata;

import com.epam.catgenome.controller.AbstractRESTController;
import com.epam.catgenome.controller.Result;
import com.epam.catgenome.entity.metadata.MetadataVO;
import com.epam.catgenome.manager.metadata.MetadataSecurityService;
import com.wordnik.swagger.annotations.Api;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiResponse;
import com.wordnik.swagger.annotations.ApiResponses;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@Api(value = "metadata", description = "Metadata Management")
@RequestMapping(value = "/metadata")
public class MetadataController extends AbstractRESTController {

    private final MetadataSecurityService metadataSecurityService;

    @PostMapping
    @ApiOperation(
            value = "Creates or updates metadata",
            notes = "Creates or updates metadata",
            produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiResponses(
            value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
            })
    public Result<MetadataVO> upsertMetadata(@RequestBody final MetadataVO metadataVO) {
        return Result.success(metadataSecurityService.upsert(metadataVO));
    }

    @GetMapping
    @ApiOperation(
            value = "Loads metadata by entity ID and class",
            notes = "Loads metadata by entity ID and class",
            produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiResponses(
            value = {@ApiResponse(code = HTTP_STATUS_OK, message = API_STATUS_DESCRIPTION)
            })
    public Result<MetadataVO> getMetadata(@RequestParam final Long id, @RequestParam final String entityClass) {
        return Result.success(metadataSecurityService.get(id, entityClass));
    }
}

@@ -2164,45 +2164,8 @@
 t%22)%0A
-@RequestMapping(value = %22/metadata%22)%0A
 publ
@@ -2302,32 +2302,53 @@
     @PostMapping
+(value = %22/metadata%22)
 %0A    @ApiOperati
@@ -2821,16 +2821,37 @@
 tMapping
+(value = %22/metadata%22)
 %0A    @Ap

Fix metadata controller path