Skip to content

BelmoMusta/Intellij-REST-Creator-Plugin

Repository files navigation

Intellij-REST-Creator-Plugin

This plugin helps to generate Spring REST controller endpoints by just using the signature of that endpoint.

Examples

In the intellij idea editor, writing the endpoint signature and press ctrl + space ( or whatever key stroke for autocompletion), this action will provide an option to create the equivalent REST endpoint.

URL GENERATED METHOD
GET /user/{id}
    /*
     * Generated from 'GET user/{id}'
     */
    @GetMapping("user/{id}")
    public ResponseEntity<?> getUserById(@PathVariable("id") Long id) {
        //FIXME: Provide a valid implementation for this method
        throw new RuntimeException("Not implemented yet");
    } 
get post/{id}/book/?name=&kk=
    /*
     * Generated from 'get post/{id}/book/?name=&kk='
     */
    @GetMapping("post/{id}/book/")
    public ResponseEntity<List<?>> getPostBookByPostId(@PathVariable("id") Long postId,
                                                       @RequestParam("name") String name,
                                                       @RequestParam("kk") String kk) {
        //FIXME: Provide a valid implementation for this method
        throw new RuntimeException("Not implemented yet");
    }
POST /book
    /*
     * Generated from 'POST /book'
     */
    @PostMapping("/book")
    public ResponseEntity<Void> createBook(@RequestBody Object requestBody) {
        //FIXME: Provide a valid implementation for this method
        return ResponseEntity.status(HttpStatus.CREATED).build();
    }
The imports section is updated as well, to include introduced references by the created method.

About

Plugin to create REST API endpoints via signature autocompletion

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages