Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide API for @RestController Spring Beans #386

Closed
fabapp2 opened this issue Sep 7, 2022 · 1 comment · Fixed by #387
Closed

Provide API for @RestController Spring Beans #386

fabapp2 opened this issue Sep 7, 2022 · 1 comment · Fixed by #387
Labels
type: enhancement New feature or request
Milestone

Comments

@fabapp2
Copy link
Collaborator

fabapp2 commented Sep 7, 2022

What needs to be done

A FindRestControllerBeans finder should find all classes annotated with @RestController and return them as RestControllerBeans offering an API dedicated to @RestControllers.

Why it needs to be done

This API will ease creating Tests for @RestController, introducing Spring Cloud Contract and all sorts of Spring web-related recipes.

Acceptance Criteria

The API should provide all information provided by @RestController or any method annotated with request mapping annotations like @GetMapping or RequestMapping(...)

A RestControllerBean has a set of RestMethod.
RestMethod provides an API to retrieve all information provided through request mapping annotations.

Additional Information

@fabapp2 fabapp2 added the type: enhancement New feature or request label Sep 7, 2022
@fabapp2
Copy link
Collaborator Author

fabapp2 commented Sep 7, 2022

Enhance RestControllerSpring Bean support to handle RequestMapping on type level with all supported attributes

The implementation currently only handles @RequestMapping/Get/Post/...Mapping annotations.

Supported at the type level as well as at the method level!

	/**
	 * The HTTP request methods to map to, narrowing the primary mapping:
	 * GET, POST, HEAD, OPTIONS, PUT, PATCH, DELETE, TRACE.
	 * <p><b>Supported at the type level as well as at the method level!</b>
	 * When used at the type level, all method-level mappings inherit this
	 * HTTP method restriction.
	 */
	RequestMethod[] method() default {};

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant