I want to understand why Spring application is starting if I have same 2 requestMapping URL,params(no params) and produces type(JSON).By default the methods is producing JSON(I tested XML and others and I get 500 error, I don't have dependencies).I want to know if it is a Intellij or Spring problem,or is it normal to start and to get overriden second Get
becouse if I put produces = MediaType.APPLICATION_JSON_VALUE
on the second too,I get error.Here is the example that work:
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<ExampleDTO>> getMethodd1() {
return ResponseEntity.ok(ExampleStore.available);
}
@GetMapping()
public ResponseEntity<List<ExampleDTO>> getMethodd2() {
return ResponseEntity.ok(ExampleStore.available);
}
And this example doesn't start anymore:
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<ExampleDTO>> getMethodd1() {
return ResponseEntity.ok(ExampleStore.available);
}
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<ExampleDTO>> getMethodd2() {
return ResponseEntity.ok(ExampleStore.available);
}
PS:I know a request should be different by params or url.