Changelog rest-expanders

Filter x

2.3.0 (2021-06-02)

This version contains several breaking changes. Please refer to the update guide in the documentation for more information about these changes and what code is affected.

Fixed

  • Results from GETlist endpoint is now sorted by database identifier by default.
  • Return the correct calculated page value in pagination parameters.
  • (REST-25) Return the correct calculated page size in pagination parameters.
  • (REST-23) Handle byte[] value fields correctly in REST API.

Added

  • (REST-15) Support for sortby parameter on getList endpoint.
  • (REST-15) Added Component and DataElement options jaxrs.endpoint.getList.sorting.disable to disable support for sorting through the API.

Changed

  • Merged changes from version 1.17.0.
  • Updated expander dependency:
    • net.democritus:querysearch-expanders: 2.3.2 > 2.4.0
  • (REST-21) All ValidationError constants in the ValidationError class are now marked final.
  • (REST-27) Integrated RestFacade methods for POST, PUT, PATCH and DELETE into the Connector class.
  • (REST-28) Integrated RestFacade methods for GETresource into the Connector class.
  • (REST-29) Integrated RestFacade methods for GETlist into the Connector class.
  • (REST-29) RestFacade.applyPagination() moved to new Pagination class.

Removed

  • Following the addition of pagination expander options, the pagination anchors in applyPagination() have been removed.
  • (REST-26) RestFacade class has been removed. The transient ApplicationInstance option jaxrs.transient.generateFacade.enable has been added to re-enable expansion of this class, along with all of its contents. However, all default endpoints will still use the new implementation.

2.2.0 (2021-05-06)

Added

  • convert-before anchors in CustomCommandResult.from() method.

Changed

  • (REST-19) The QuerySearch instance used by the REST API is now marked with the option jaxrs.querySearch.
  • Updated expander dependency:
    • net.democritus:querysearch-expanders: 2.2.0 > 2.3.2

2.1.0 (2021-03-25)

Added

  • (REST-14) New DataOption jaxrs.endpoint.getList.defaultPage to set the value of DEFAULT_PAGE in the RestFacade class.
  • (REST-14) New DataOption jaxrs.endpoint.getList.defaultPageSize to set the value of DEFAULT_PAGE_SIZE in the RestFacade class.
  • (REST-18) New DataOption jaxrs.endpoint.getList.maxPageSize to set a fixed maximum page size for GETlist requests.

Changed

  • Updated expander dependency:
    • net.democritus:Expanders: 4.13.4 > 4.13.5
    • net.democritus:querysearch-expanders: 2.0.0 > 2.2.0

2.0.2 (2021-03-11)

Fixed

  • (REST-13) Dynamic registration of QuerySearch object can cause concurrency exceptions.

2.0.1 (2021-03-08)

Fixed

  • Dockerfile for documentation referenced to old filename.

2.0.0 (2021-03-08)

Changed

  • Updated expander dependency:
    • net.democritus:nsx-default-stack: 2021.0.1 > 2021.1.1
    • net.democritus:Expanders: 4.13.2 > 4.13.4
    • net.democritus:querysearch-expanders: 1.9.0 > 2.0.0
  • (REST-12) Populate QuerySearch model instead of enableQuerySearch option when includeJaxrsConnector is present on a DataElement.

1.17.0 (2021-05-19)

Added

  • Added feature anchors to ElementConnectorExpander:
    • post-mapper
    • post-command
    • put-mapper
    • put-command
    • patch-mapper
    • patch-command
    • delete-command

1.16.0 (2021-02-17)

This version contains some breaking changes. Please refer to the update guide in the documentation for more information about this change and what code is affected.

Added

  • New rest-jaxrs-stack expansion resource bundle which contains the rest-expanders bundle, rest-basic-auth-expanders and all their dependencies.
  • New rest-account-security-expanders bundle which ties the default generated endpoints in with the access control functionality of the account base component, which allows the definition of security rights at runtime in the DataAccess element. This is activated with the component option jaxrs.account.accessControl.enable.

Changed

  • Updated expander dependency:
    • net.democritus:Expanders: 4.12.1 > 4.13.2
  • Restructured expander project to support multiple expansion resource projects as rest-expanders-stack.
  • Moved the rest-basic-auth-expanders into the codebase of the rest-expanders-stack and matched the version to that of the rest-expanders.
  • SecurityRight class moved from shared to control.
  • Moved the definition of the WWW-Authenticate header to a separate AuthenticateResponseHeaderBuilder class for cleaner feature injection.

1.15.0 (2021-02-01)

This version contains some breaking changes in several expanders that can be opted-out in the short-term by using the ApplicationInstanceOption jaxrs.transient.exposeDiagnostics.enable. Please refer to the update guide in the documentation for more information about this change and what code is affected.

Fixed

  • Harvesting and expanding of ext files in the integration project did not work correctly.

Added

  • Exceptions where diagnostics are available now have these written to the log when they occur on a REST call.
  • Added WWW-Authenticate header to response in NotAuthorizedExceptionHandler.

Changed

  • Updated expander dependency:
    • net.democritus:Expanders: 4.4.12 > 4.12.1
  • Replaced makeshift injection of the CommandExtension classes in the logic Bean with feature injection for commands which are now supported in the main expanders. The old code which was automatically injected into custom anchors is also automatically removed, given that it was not altered.
  • Improvements to expanders for exception handling interceptors.
  • Errors on REST calls where diagnostics were made available in the error response no longer include the diagnostics. This can be re-enabled by using the transient option jaxrs.transient.exposeDiagnostics.enable.
  • ValidationException class moved from shared to control.

Removed

  • The transient option rest.compatibility.generateUuid introduced in version 1.4.0 was removed.

1.14.0 (2021-01-21)

Fixed

  • Changed incorrect parameter nullable annotation for RestErrorResponseBuilder.setError().

Added

  • New RestErrorResponseBuilder.addHeader() method to add additional headers to error responses.

Changed

  • Updated expander dependency:
    • net.democritus:querysearch-expanders: 1.8.0 > 1.9.0

1.13.0 (2021-01-07)

This version contains some breaking changes in several expanders that can be opted-out in the short-term by using the ApplicationInstanceOption jaxrs.transient.useQualifiedNames.disable. Please refer to the update guide in the documentation for more information about this change and what code is affected.

Fixed

  • Corrected error message in DeletionFailedInterceptor.

Changed

  • Updated expander dependency:
    • net.democritus:Expanders: 4.4.4 > 4.4.12
    • net.democritus:querysearch-expanders: 1.7.0 > 1.8.0
  • Qualified some variable/method argument names to prevent obvious collisions with DataElement names. This is a breaking change that can be opted-out in the short-term by using the ApplicationInstanceOption jaxrs.transient.useQualifiedNames.disable.

1.12.0 (2020-10-05)

Added

  • Added feature anchors to ElementConnectorExpander:
    • getList-filter
    • get-filter

Changed

  • Updated expander dependency:
    • net.democritus:querysearch-expanders: 1.5.0 > 1.7.0
  • Updated dependencies in integration test project:
    • NSX Runtime: 2019.7.1 > 2020.9.0

1.11.3 (2020-07-31)

Fixed

  • Use correct comment format for feature anchors in SwaggerUiExpander.

1.11.2 (2020-07-31)

Fixed

  • Set the correct oauth2RedirectUrl in the Swagger UI page.

Added

  • Added anchors to SwaggerUiExpander:
    • before-setup
    • config
    • after-setup

1.11.1 (2020-07-29)

Fixed

  • The result of the fillers in the command extensions should be propagated if it is an error.

1.11.0 (2020-07-01)

Changed

  • Allow all OPTIONS calls to bypass authorization.
  • CommonDataValidator classes now return on empty input parameters.
  • Updated expander dependency:
    • net.democritus:querysearch-expanders: 1.4.0 > 1.5.0

1.10.0 (2020-06-02)

Added

  • Support for proxies by processing the Forwarded, X-Forwarded-Host and X-Forwarded-Proto headers.
  • BaseUrlContext.from(Context) method to easily retrieve the context.
  • BaseUrlContext.from(ParameterContext<?>) method to easily retrieve the context.

Changed

  • Replaced BaseUrlContext.EMPTY field with BaseUrlContext.empty() method as the context is not immutable and the content of the EMPTY could be overwritten.
  • Updated expander dependency:
    • net.democritus:querysearch-expanders: 1.3.2 > 1.4.0

1.9.2 (2020-05-15)

Fixed

  • Swagger-JAXRS was overwriting part of the swagger definition.

Added

  • Added updateOperation(String, HttpMethod, Operation) method to the SwaggerServlet class.

1.9.1 (2020-05-15)

Fixed

  • Authorization did not apply the filter blocking anonymous access.

1.9.0 (2020-05-15)

As of this version, anonymous access to the REST API is blocked by default. To restore the old behavior of allowing anonymous access, add the option jaxrs.auth.anonymous.enable. Alternatively you can use the net.democritus:rest-basic-auth-expanders bundle to provide basic authentication that uses the account component.

Added

  • Added jaxrs.auth.anonymous.enable component option to allow anonymous access to the API.
  • Added parsing of the Authorization header to AuthenticationProvider to provide a clean hook to implement one or more authentication methods.

Changed

  • Anonymous access to the API is now blocked by default. An authentication implementation must be added or the method jaxrs.auth.anonymous.enable.
  • REST expanders are now built against expanders version 4.4.4.

1.8.4 (2020-05-14)

  • Corrected enable condition to generate the DataElementOutputSchema.json files.

1.8.2 (2020-05-14)

Added

  • Added updateSecurity(Map) method to the SwaggerServlet class.

1.8.1 (2020-05-13)

Fixed

  • The SwaggerServlet did not completely update the Swagger definition.

1.8.0 (2020-05-13)

Fixed

  • Reverted Jackson dependency in application 2.11.0 > 2.10.3 due to runtime compatibility issues with Jersey.

Added

  • Added new MalformedHeaderException class, along with exception handler and error code BR014.
  • Added static from(Context) method to the user context class.
  • Added update(UserContext) method to the user context class to update its fields from another context.
  • Added updateSecurityDefinitions(Map) method to the SwaggerServlet class.
  • Added imports, fields and methods anchors to the SwaggerServlet class.

Changed

  • Replaced the ANONYMOUS and SYSTEM variables with static factory methods in the user context. This will prevent accidental caching of system access when modifying the user context.

1.7.0 (2020-05-13)

For any projects that might already use the integration test project, beware that you must move your harvest files due to the classes in the integration project moving locations.

Added

  • Schema validation in the test project for GET calls to retrieve individual resources.

Changed

  • Updated anchor-removal-plugin in the test project to version 1.1.
  • Moved all classes except for unit test classes into the main sources folder of the test project.
  • Updated dependencies in application:
    • Jackson: 2.10.3 > 2.11.0
      • Changes 2.11.0: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.11
    • JetBrains Annotations: 18.0.0 > 19.0.0
      • Changes 19.0.0: https://github.com/JetBrains/java-annotations/releases/tag/19.0.0

1.6.0 (2020-05-11)

Fixed

  • The uniqueness data validation did not handle null values correctly.

Changed

  • REST expanders are now built against querysearch expanders version 1.3.2.

1.5.2 (2020-05-06)

Fixed

  • The OutputListModel class did not compile when the plural was the same as the singular in the externalName option.

1.5.1 (2020-05-05)

Fixed

  • The code injected into the QuerySearch classes no longer uses the deprecated when() method.

1.5.0 (2020-05-02)

Fixed

  • Increased priority for JSONMappingException and JSONParseException handlers to prevent the default handlers from firing when JacksonJsonProvider is used for a REST client.
  • Incorrect import in the REST integration testing project.
  • If no command is defined for an endpoint, there should be no validators generated for fields that have the exposeRestField option.

Added

  • Support for expansion resource dependencies. net.democritus:Expanders and net.democritus:querysearch-expanders are now listed as dependencies.

Changed

  • REST expanders are now built against expanders version 4.3.10.
  • REST expanders are now built against querysearch expanders version 1.3.1.

1.4.0 (2020-04-22)

This version breaks backwards compatibility for UUID fields. Use the option ApplicationInstance option rest.compatibility.generateUuid to re-enable this behavior or add the option generateUuid to all fields with the name uuid.

Added

  • Added ApplicationInstance option rest.compatibility.generateUuid to replicate the old behavior of the REST expanders to generate a UUID for all fields with the name uuid.
  • Added support for Hibernate as persistence provider.

Changed

  • Updated dependencies:
    • Jersey: 2.29.1 > 2.30.1
      • Changes: 2.30: https://eclipse-ee4j.github.io/jersey.github.io/release-notes/2.30.html
      • Changes: 2.30.1: https://eclipse-ee4j.github.io/jersey.github.io/release-notes/2.30.1.html
    • Jackson: 2.10.0 > 2.10.3
      • Changes 2.10.1: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.10.1
      • Changes 2.10.2: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.10.2
      • Changes 2.10.3: https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.10.3
    • Swagger: 1.5.24 > 1.6.1
      • Changes 1.6.0: https://github.com/swagger-api/swagger-core/releases/tag/v1.6.0
      • Changes 1.6.1: https://github.com/swagger-api/swagger-core/releases/tag/v1.6.1

1.3.0 (2020-04-03)

Fixed

  • The Apache Commons Lang 3 dependency was missing in the control layer for the validation system.

Added

  • (EXPERIMENTAL) Expanding integration tests for REST.

1.2.3 (2020-03-23)

Fixed

  • The Location header was not correctly generated in the POST endpoint when the resource identifier is given in includeJaxrsConnector.

1.2.2 (2020-03-06)

Fixed

  • URL validation method was not generated in the ValidationBean for customized endpoints.

Changed

  • Removed regular expression description in ValidationError class.

1.2.1 (2020-03-05)

Fixed

  • The CORS implementation generated an unintended exception on pre-flight requests and also did not send the Allow header on pre-flight requests.

Added

  • Added a provider to handle OPTIONS calls to the REST API when the request is not a CORS request. Before this was handled by JAX-RS internally.

1.2.0 (2020-02-26)

Fixed

  • Empty string was injected into the QuerySearch for a DataElement if no valid functionalKey was defined for a REST connector.
  • Excludes of swagger files were handled incorrectly in the AuthorizationProvider.

Changed

  • Split off the builder classes for the CreatedResponse and RestErrorResponse into separate files.
  • Added expander comment to all expanders.
  • Updated CORS filter:
    • Access-Control-Allow-Methods now contains only the methods available at the addressed endpoint.
    • Access-Control-Allow-Headers is now returned for CORS requests, containing the allowed headers that were requested in Access-Control-Request-Headers.
  • The implementation of the validation pipeline was moved to a new ValidationBean in the logic layer, to allow the use of feature anchors.

1.1.2 (2020-02-17)

Fixed

  • Updated enable conditions for data validator classes to check for includeJaxrsConnector.

Changed

  • Support added for if_empty value in generateUuid option, allowing users to pass a uuid in POST. It will only be generated if no uuid was given.

1.1.1 (2020-02-13)

Fixed

  • The enable condition for the DataElementReferenceModel and DataElementReferenceMapper classes was too restrictive. Now generates even when there is no GET endpoint.

Changed

  • Provided a new implementation to format validation error messages. The previous implementation relied on commons-lang3, which due to the Struts upgrade in the 3.2.0 version of the main expander bundle is causing conflicts with TomEE 7. The depedency on commons-lang3 has been removed.

1.1.0 (2020-02-12)

Requires (at least) version 4.2.0 of the main expander bundle.

Fixed

  • The swagger annotation for the 201 Created response on POST endpoints referenced the wrong response model class.
  • The name for validation result variables of link fields in the data validators was incorrect.
  • Generation of input validators failed when no command was found for the endpoint.

Changed

  • The option generateUuid available in the main expanders starting at version 4.1.2 is now supported instead of the field uuid: String to automatically generate a UUID (and related functionality in REST). To preserve backwards compatibility, the option will implicitly be added to fields with signature uuid: String by this expander bundle.

Removed

  • EditorConfig file expander has been moved into the main expander bundle. Available starting at version 4.1.2.
  • gen_test folders are now generated by the main expander building. Available starting at version 4.1.2.

0.11.0 (2020-08-10)

Changed

  • [1.x backport] Expander bundle now requires Java 8. (Expanded code is still Java 7 compatible.)
  • [1.x backport] Support for expander dependency system.
  • [1.x backport] Removed EditorConfig expanders as these are now integrated into net.democritus:Expanders.
  • [1.x backport] Removed UUID generation support, now implicitly adding generateUuid option to fields with signature uuid: String.