package org.superdev.coddy.snippet.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.superdev.coddy.snippet.elasticsearch.entity.SnippetEntity;
import org.superdev.coddy.snippet.service.SnippetService;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import java.util.List;

@Component
@Path("/snippet")
public class Snippet {

    @Autowired
    private SnippetService snippetService;

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @Consumes(MediaType.APPLICATION_JSON)
    public List<SnippetEntity> getSnippets() {
        return snippetService.getSnippets();
    }

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @Consumes(MediaType.APPLICATION_JSON)
    @Path("{id}")
    public SnippetEntity getSnippet(@PathParam("id") String id) {
        return snippetService.getSnippet(id);
    }

    @POST
    @Produces(MediaType.APPLICATION_JSON)
    @Consumes(MediaType.APPLICATION_JSON)
    public void createSnippet(@RequestBody SnippetEntity snippet) {
        snippetService.createSnippet(snippet);
    }
}

@@ -150,68 +150,8 @@
 nt;%0A
-import org.springframework.web.bind.annotation.RequestBody;%0A
 impo
@@ -1018,21 +1018,8 @@
 pet(
-@RequestBody 
 Snip

Remove (useless) requestBody