Uploaded image for project: 'Spring Data REST'
  1. Spring Data REST
  2. DATAREST-1268

Support RepositoryDetectionStrategies.EXPLICIT_METHOD_ANNOTATED

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.8 (Kay SR8)
    • Fix Version/s: 3.0.10 (Kay SR10)
    • Component/s: None
    • Labels:
      None

      Description

      In the RepositoryDetectionStrategy interface, there's an EXPLICIT_METHOD_ANNOTATED strategy defined. Afaict, it is not documented and not implemented. It does exactly the same as the ANNOTATED strategy, both call isExplicitlyExported:

      		/**
      		 * Considers repositories that are annotated with {@link RepositoryRestResource} or {@link RestResource} and don't
      		 * have the {@code exported} flag not set to {@literal false}.
      		 */
      		ANNOTATED {
      
      			@Override
      			public boolean isExported(RepositoryMetadata metadata) {
      				return isExplicitlyExported(metadata.getRepositoryInterface(), false);
      			}
      		},
      
      		/**
      		 * Behaves like the annotated strategy on repository level. But it does not export all methods
      		 * of an exported Repository. The methods have to be annotated explicitly too.
      		 */
      		EXPLICIT_METHOD_ANNOTATED {
      
      			@Override
      			public boolean isExported(RepositoryMetadata metadata) {
      				return isExplicitlyExported(metadata.getRepositoryInterface(), false);
      			}
      		};
      

      The JavaDoc is misleading here and tricked me into thinking this would not export our methods unless we annotate them.

      It would be a very useful setting to ensure that no method is exported by accident. It would be great if it could be implemented.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              olivergierke Oliver Drotbohm
              Reporter:
              darioseidl Dario Seidl
              Last updater:
              Mark Paluch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: