newhoo / RestfulBox

A powerful toolkit for restful services development.
https://plugins.jetbrains.com/plugin/14723-restfulbox
Apache License 2.0
52 stars 18 forks source link

Duplicate entries when annotations in interfaces #13

Closed romeucr closed 2 years ago

romeucr commented 2 years ago

We use interfaces and Implementations for controllers and interfaces annotated with Spring's annotations also are included on the Found Services list, causing duplicated entries. Maybe makes more sense to add only the ones implemented. Anyway, thanks for the great tool :D

newhoo commented 2 years ago

Show me your code or screenshot please.

romeucr commented 2 years ago

We use a contract first approach and what I have is the interface:

    @RequestMapping( value = "/policies/receipts/unpaid/excel",
                     produces = { "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }, 
                     method = RequestMethod.GET )
    ResponseEntity< byte[] > myMethod() { ... }

And the implementation:

    @GetMapping(value = "/receipts/unpaid/excel", produces = Constants.APPLICATION_MS_EXCEL)
    public ResponseEntity<byte[]> myMethod() { ... }

Also, the service list is not ordenated in alphabetical order. That would be nice too.

newhoo commented 2 years ago

We use a contract first approach and what I have is the interface:

    @RequestMapping( value = "/policies/receipts/unpaid/excel",
                     produces = { "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" }, 
                     method = RequestMethod.GET )
    ResponseEntity< byte[] > myMethod() { ... }

And the implementation:

    @GetMapping(value = "/receipts/unpaid/excel", produces = Constants.APPLICATION_MS_EXCEL)
    public ResponseEntity<byte[]> myMethod() { ... }

Also, the service list is not ordenated in alphabetical order. That would be nice too.

What's your RESTKit version? It's ok in my idea with latest version 2.0.5 image

image
romeucr commented 2 years ago

I am using the same version as you, the 2.0.5. As I said, we use a Contract first approach and, besides the interface and implementation, we have the "contract" that is an yaml that defines the endpoints that the controller has. The yaml is something like that:

receipts-unpaid-excel:
    get:
      tags:
        - policies
      description: a description... 
      operationId: myMethod
      responses:
        "200":
          description: OK
          content:
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                type: string
                format: byte
      security:
        - appToken: []
        - apiToken: []
      deprecated: false

Not sure what else to look. : (

romeucr commented 2 years ago

When I do a search, this is what I get. The API is the interface. It appears 2 times in the search

image

newhoo commented 2 years ago

sorry, this plugin does not analyze this yaml. please give me some exception detail the plugin occurred, screenshot or exception stacks. so i can know which line that caused your problem.

newhoo commented 2 years ago

When I do a search, this is what I get. The API is the interface. It appears 2 times in the search

image

it's ok. it's difficult to filter when using Inheritance or implementation. https://github.com/newhoo/RESTKit/issues/9