A library that tests if the implementation of a REST-API meets its specification.

Overview

hikaku

Build Status Maven Central Version

Hikaku (比較) is japanese and means "comparison". This library tests if a REST-API implementation meets its specification.

If you create your REST-API contract-first without using any type of generation, you have to make sure that specification and implementation don't diverge. The aim of this project is to meet this need and offer a mechanism to check specification and implementation for equality without having to create requests which are fired against a mock server. So this library won't check the behavior of the API, but the structural correctness. Please see also the section limitations

Currently supported

Please refer to the list of all features. To check the feature support for each converter. It is possible that not every converter supports every feature. Only the intersection of the features of two EndpointConverters is used for the matching. Please keep that in mind regarding the equality of implementation and specification.

Usage

Setting up a test with hikaku is very simple. You just instantiate the Hikaku class and provide an EndpointConverter for the specification and another one for the implementation. Optionally, you can also pass an instance of HikakuConfig. Check the list of options and default values of the config. Then you call match() on the Hikaku class. The match result is sent to one or multiple Reporter. If the test fails kotlin's DefaultAsserter.fail() method is called.

Example

There is an artifact for each converter. So we need one dependency for the specification and one for the implementation. In this example our project consists of an OpenAPI specification and a Spring implementation. The specification does not contain the /error endpoints created by spring, so we want to omit those. First add the dependencies for the converters, that we want to use. In this case hikaku-openapi and hikaku-spring.

dependencies {
    testImplementation "de.codecentric.hikaku:hikaku-openapi:$hikakuVersion"
    testImplementation "de.codecentric.hikaku:hikaku-spring:$hikakuVersion"
}

Kotlin

And now we can create the test case:

@SpringBootTest
class SpecificationTest {

    @Autowired
    private lateinit var springContext: ApplicationContext

    @Test
    fun `specification matches implementation`() {
        Hikaku(
                specification = OpenApiConverter(Paths.get("openapi.yaml")),
                implementation = SpringConverter(springContext),
                config = HikakuConfig(
                        filters = listOf(SpringConverter.IGNORE_ERROR_ENDPOINT)
                )
        )
        .match()
    }
}

Java

Same example in Java:

@SpringBootTest
public class SpecificationTest {

  @Autowired
  private ApplicationContext springContext;

  @Test
  public void specification_matches_implementation() {
    List<Function1<Endpoint, Boolean>> filters = new ArrayList<>();
    filters.add(SpringConverter.IGNORE_ERROR_ENDPOINT);

    List<Reporter> reporters = new ArrayList<>();
    reporters.add(new CommandLineReporter());

    new Hikaku(
            new OpenApiConverter(Paths.get("openapi.json")),
            new SpringConverter(springContext),
            new HikakuConfig(
                    reporters,
                    filters
            )
    )
    .match();
  }
}

Limitations

Hikaku checks the implementation with static code analysis. So everything that is highly dynamic is not covered by hikaku. There might be other libraries and frameworks that can cover these aspects by checking the behavior.

http status codes

For implementations the status codes are very dynamic. There are various ways to set a http status. For example using a ResponseEntity object in spring or using additional filters and so on. That's why hikaku does not support http status codes.

Request and response object

For implementations both request and response objects are highly dynamic. For response objects there might be a generic ResponseEntity as well or interfaces with different implementations can be used. In both cases (request and response) the objects can be altered by a serialization library and there a lot of different libs out there. That's why hikaku neither supports request nor response objects.

More Info

Comments
  • Unable to get code running on OpenJDK 11

    Unable to get code running on OpenJDK 11

    Setup information

    hikaku version: 3.0.0 specification converter: OpenApiConverter implementation converter: SpringConverter build tool and version: gradle-5.6.2 test framework: SpockFramework

    Describe the bug

    Hikaku is unable to run test using Java 11

    hikaku.match()
    |      |
    |      de.codecentric.hikaku.converters.EndpointConverterException: Retrieving groups by name is not supported on this platform.
    |      	at de.codecentric.hikaku.converters.openapi.OpenApiConverter.convert(OpenApiConverter.kt:46)
    |      	at de.codecentric.hikaku.converters.AbstractEndpointConverter$conversionResult$2.invoke(AbstractEndpointConverter.kt:11)
    |      	at de.codecentric.hikaku.converters.AbstractEndpointConverter$conversionResult$2.invoke(AbstractEndpointConverter.kt:8)
    |      	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
    |      	at de.codecentric.hikaku.Hikaku.match(Hikaku.kt:41)
    |      	at com.kws.cultivent.fieldservice.FieldManagementApiIntegrationTest.Check IMPLEMENTATION and SPECIFICATION(FieldManagementApiIntegrationTest.groovy:67)
    |      Caused by: java.lang.UnsupportedOperationException: Retrieving groups by name is not supported on this platform.
    |      	at kotlin.internal.jdk8.JDK8PlatformImplementations.getMatchResultNamedGroup(JDK8PlatformImplementations.kt:28)
    |      	at kotlin.text.MatcherMatchResult$groups$1.get(Regex.kt:259)
    |      	at kotlin.text.jdk8.RegexExtensionsJDK8Kt.get(RegexExtensions.kt:33)
    |      	at de.codecentric.hikaku.converters.openapi.extractors.QueryParameterExtractor.extractQueryParametersFromComponents(QueryParameterExtractor.kt:30)
    |      	at de.codecentric.hikaku.converters.openapi.extractors.QueryParameterExtractor.invoke(QueryParameterExtractor.kt:12)
    |      	at de.codecentric.hikaku.converters.openapi.OpenApiConverter.parseOpenApi(OpenApiConverter.kt:70)
    |      	at de.codecentric.hikaku.converters.openapi.OpenApiConverter.convert(OpenApiConverter.kt:44)
    |      	... 5 more
    

    Expected behavior

    Code should work in the same way as on JDK 8 or any idea for a workaround

    Code samples

    Can you provide specification snippets or code snippets?

    new Hikaku(
            openApiConverter,
            springConverter,
            hikakuConfig
          ).match()
    
    Bug OpenAPI 
    opened by terribleherbst 9
  • Evaluate possibility to check response objects

    Evaluate possibility to check response objects

    It would be beneficial to check the structural equality of data transfer objects (DTO) as well.

    • Check possibilites to retrieve that data throughout existing converters
    • Brainstorm hikaku internal presentation or data structure
    • Think about ways to present results in CommandLineReporter
    Discussion 
    opened by cc-jhr 6
  • HikakuConfig: add possibility to filter the endpoints with a custom predicate

    HikakuConfig: add possibility to filter the endpoints with a custom predicate

    Hi, for a project I needed a little bit more flexibility for ignoring the endpoints paths.

    The provided ignorePaths in HikakuConfig is restrictive as you need an exact match.

    I've added a new endpointFilter predicate that the user can customize as he wants :)

    I hope that you will find it useful :)

    Thanks!

    opened by syjer 5
  • Support equals if content type matches and ignore charset

    Support equals if content type matches and ignore charset

    Setup information hikaku version: 2.0.0-SNAPSHOT specification converter: OpenApiConverter implementation converter: SpringConverter

    Describe the bug When the API specification states application/json as content type byt the implementation return application/json;charset=UTF-8 they are not treated as equals. I am not sure if this is bug or maybe more a feature request (and there seems only be a bug template here), but if the implementation fullfills a contract the match should be OK.

    Expected behavior IMHO application/json;charset=UTF-8 is a valid implementation when application/json is required and should not be reported as an error.

    Hikaku Discussion 
    opened by terribleherbst 5
  • Spring Redirect Enpoint : produces attribute not empty

    Spring Redirect Enpoint : produces attribute not empty

    Setup information

    hikaku version: 3.0.0 specification converter: OpenApiConverter implementation converter: SpringConverter build tool and version: gradle 5.6.4 test framework: junit5

    Describe the bug

    Hi, we have a problem with Spring endpoints which must return a redirect URL (status 302 or 301). When we run the Hikaku test, Hikaku generate a "produces" attribute for this endpoint, and so the test fail because our OpenApi Endpoint doesn't have a content.

    This generation of produces attribute is in the ProducesSpringExtension, and for now, to have a empty produces, the endpoint have to respect one of these condition :

    • no return and no HttpServletResponseParam and no error in path
    • no @ResponseBody and no @RestController and no error in path In other case, it used the produces (if it's present) or put a default produces

    Expected behavior

    When endpoint :

    • return a "RedirectView" or
    • method has a param HttpServletResponse and no return Then ProducesSpringExtension return the produces attribute define in the endpoint.

    N.B. : when we do a redirect with the HttpServletResponse, we don't have to specify a @ResponseStatus but this is the only way I think to differentiate in the ProducesSpringExtension a Redirect from another status

    Code samples

    Sample of the current bug

    @GetMapping("/github")
        fun redirectToGithub(): RedirectView {
            return RedirectView("https://github.com/codecentric/hikaku")
        }
    
    //or with the HttpServletReponse
    @GetMapping("/github")
    fun redirectToGithub(response: HttpServletResponse) {
            response.sendRedirect("https://github.com/codecentric/hikaku")
        }
    

    I can if you want suggest a PR.

    Bug Spring 
    opened by drapej 4
  • Add list of responses for OpenApiConverter

    Add list of responses for OpenApiConverter

    Affects: OpenApiConverter

    I would like to assert whether an endpoint contains one of responses as stated in a contract (at least status codes).

    Proposed solution: Endpoint class would contain additional property: responses/response. Add additional "extractor" to perform extraction of responses/response.

    Feature Request 
    opened by BranislavLazic 4
  • Parameter referenced from components are not detected

    Parameter referenced from components are not detected

    Setup information hikaku version: 1.1.0 specification converter: OpenApiConverter implementation converter: SpringConverter build tool and version gradle test framework spock

    Describe the bug In my OpenAPI specification I have described parameter like the following in the path sectio

    parameters:
            - $ref: "#/components/parameters/tenantParam"
            - name: qrCode
              in: query
              example: 0101234567890123sd0DE012-1234567-xyz
              description: The qr code 
              schema:
                type: string
    

    In the parameter section tenantParam is described as

        tenantParam:
          name: tenant
          in: query
          description: The tenant of a user
          schema:
            $ref: "#/components/schemas/Tenant"
          example: de
    

    And the schema as

        Tenant:
          type: string
          minLength: 2
          maxLength: 2
          example: de
    

    While the qrCode parameter is checked as expected the tenant parameter is shown as Unexpected but found and not listed in the report.

    Expected behavior Parmeters should be handled the same when added directly in the param section as when a reference is used. The same seems to happen with all other referenced parameters.

    Code samples: Can you provide specifications or code snippets?

      def "Check implementation vs specification of api"() {
        given:
          def path = Paths.get("../spec/my-api.yaml")
          OpenApiConverter openApiConverter = OpenApiConverter.usingPath(path);
          SpringConverter springConverter = new SpringConverter(springContext);
    
          HikakuConfig hikakuConfig = new HikakuConfig(
            [SpringConverter.IGNORE_ERROR_ENDPOINT] as Set,
            true,
            true
          );
    
        when:
          def hikaku = new Hikaku(
            openApiConverter,
            springConverter,
            hikakuConfig
          )
        then:
          hikaku.match();
      }
    
    Bug OpenAPI 
    opened by terribleherbst 4
  • Fix exception: patternsCondition is Nullable

    Fix exception: patternsCondition is Nullable

    See the @Nullable annotation here: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/mvc/method/RequestMappingInfo.html#getPatternsCondition--

    See also RequestMappingInfo.java line 91 in org.springframework:spring-webmvc:5.3.14

    The current code can result in this stack trace:

    java.lang.IllegalStateException: this.patternsCondition must not be null at de.codecentric.hikaku.converters.spring.extensions.PathsSpringExtensionKt.paths(PathsSpringExtension.kt:6) at de.codecentric.hikaku.converters.spring.SpringConverter.convert(SpringConverter.kt:35) at de.codecentric.hikaku.converters.AbstractEndpointConverter$conversionResult$2.invoke(AbstractEndpointConverter.kt:11) at de.codecentric.hikaku.converters.AbstractEndpointConverter$conversionResult$2.invoke(AbstractEndpointConverter.kt:8) at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) at de.codecentric.hikaku.converters.AbstractEndpointConverter.getConversionResult(AbstractEndpointConverter.kt) at de.codecentric.hikaku.Hikaku.match(Hikaku.kt:46)

    opened by peterb-personio 3
  • Tests for JaxRsConverter and MicronautConverter fail on windows machine

    Tests for JaxRsConverter and MicronautConverter fail on windows machine

    I've cloned the project on a windows machine using gitbash and executed the tests via command line. The tests for micronaut and jax-rs are failing. This probably relates to the code that searches for classes within the project. (That's why I labeled core as well).

    I have not checked whether or not this would be the same result for a hikaku based tests using one of the mentioned converters.

    Bug Hikaku JAX-RS Micronaut 
    opened by cc-jhr 3
  • Getting exception `Retrieving groups by name is not supported on this platform`

    Getting exception `Retrieving groups by name is not supported on this platform`

    Setup information

    java version: 11 hikaku version: 2.1.0 build tool and version: maven 3.5.4 test framework: junit 4.12

    Describe the bug

    Running the following test

        @Test
        public void testApi() throws URISyntaxException {
            final HikakuConfig config = new HikakuConfig(Set.of(SpringConverter.IGNORE_ERROR_ENDPOINT));
            final Path path = Paths.get(getClass().getClassLoader().getResource("openapi.yml").toURI());
            new Hikaku(new OpenApiConverter(path), new SpringConverter(applicationContext), config).match();
        }
    

    Expected behavior

    API matching test result

    Actual result

    Exception stacktrace:

    de.codecentric.hikaku.converters.EndpointConverterException: Retrieving groups by name is not supported on this platform.
    
    	at de.codecentric.hikaku.converters.openapi.OpenApiConverter.convert(OpenApiConverter.kt:45)
    	at de.codecentric.hikaku.converters.AbstractEndpointConverter$conversionResult$2.invoke(AbstractEndpointConverter.kt:11)
    	at de.codecentric.hikaku.converters.AbstractEndpointConverter$conversionResult$2.invoke(AbstractEndpointConverter.kt:8)
    	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
    	at de.codecentric.hikaku.converters.AbstractEndpointConverter.getConversionResult(AbstractEndpointConverter.kt)
    	at de.codecentric.hikaku.Hikaku.match(Hikaku.kt:39)
    	at com.example.Api_IT.testApi(Api_IT.java:30)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74)
    	at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
    	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
    	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
    	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
    	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
    	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
    	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
    	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
    Caused by: java.lang.UnsupportedOperationException: Retrieving groups by name is not supported on this platform.
    	at kotlin.internal.jdk8.JDK8PlatformImplementations.getMatchResultNamedGroup(JDK8PlatformImplementations.kt:28)
    	at kotlin.text.MatcherMatchResult$groups$1.get(Regex.kt:259)
    	at kotlin.text.jdk8.RegexExtensionsJDK8Kt.get(RegexExtensions.kt:33)
    	at de.codecentric.hikaku.converters.openapi.extractors.QueryParameterExtractor.extractQueryParametersFromComponents(QueryParameterExtractor.kt:32)
    	at de.codecentric.hikaku.converters.openapi.extractors.QueryParameterExtractor.invoke(QueryParameterExtractor.kt:13)
    	at de.codecentric.hikaku.converters.openapi.OpenApiConverter.parseOpenApi(OpenApiConverter.kt:65)
    	at de.codecentric.hikaku.converters.openapi.OpenApiConverter.convert(OpenApiConverter.kt:43)
    	... 36 more
    
    Bug 
    opened by mih-kopylov 3
  • Wrong file encoding leads to unclear error message

    Wrong file encoding leads to unclear error message

    Setup information hikaku version: 1.1.1 (probably also in 2.0.0) specification converter: OpenApi OS: Windows 7 Enterprise

    Describe the bug If the open api specification file (e.g. openapi.json) is is read with other encoding than UTF-8 (happens on windows, apparently), then the following line in the OpenApiConverter results in an error, because openApi will be null:

     val openApi = OpenAPIV3Parser().readContents(specificationContent, null, null).openAPI
    

    Though the encoding error is expected, it is shadowed by an IllegalStateException thrown by the illegal null access. The encoding error is not an exception, but a message inside the SwaggerParseResult

    Expected behavior The encoding error should be presented to the user.

    Bug OpenAPI 
    opened by lmller 3
  • Bump micronaut-http from 3.0.0 to 3.8.0

    Bump micronaut-http from 3.0.0 to 3.8.0

    Bumps micronaut-http from 3.0.0 to 3.8.0.

    Release notes

    Sourced from micronaut-http's releases.

    Micronaut 3.8.0

    What's Changed

    Bug Fixes 🐞

    Improvements ⭐

    Other Changes 💡

    Docs 📖

    🐘 Build

    Dependency updates 🚀

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump spring-webmvc from 5.3.9 to 6.0.3

    Bump spring-webmvc from 5.3.9 to 6.0.3

    Bumps spring-webmvc from 5.3.9 to 6.0.3.

    Release notes

    Sourced from spring-webmvc's releases.

    v6.0.3

    :star: New Features

    • Throw PessimisticLockingFailureException/CannotAcquireLockException instead of plain ConcurrencyFailureException #29675
    • Introduce additional constructors in MockClientHttpRequest and MockClientHttpResponse #29670
    • Fall back to JdkClientHttpConnector as ClientHttpConnector #29645
    • Optimize object creation in RequestMappingHandlerMapping#handleNoMatch #29634
    • Align multipart codecs on client and server #29630
    • Deprecate "application/graphql+json" media type after spec changes #29617
    • HTTP interface client does not call FormHttpMessageWriter when writing form data #29615
    • ProblemDetail doesn't override the equals method #29606
    • Add title to SockJS iFrames for accessibility compliance #29594
    • Forbid loading of a test's ApplicationContext in AOT mode if AOT processing failed #29579
    • Deprecate JettyWebSocketClient in favor of StandardWebSocketClient #29576
    • Improve options to expose MessageSource formatted errors for a ProblemDetail response #29574
    • Make @ModelAttribute and @InitBinder annotations @Reflective #29572
    • Update BindingReflectionHintsRegistrar to support properties on records #29571

    :lady_beetle: Bug Fixes

    • Cannot use WebDAV methods in Spring MVC 6.0 anymore #29689
    • AnnotatedElementUtils.findMergedRepeatableAnnotations does not fetch results when other attributes exist in container annotation #29685
    • BeanWrapperImpl NPE in setWrappedInstance after invoking getPropertyValue #29681
    • SpEL ConstructorReference does not generate AST representation of arrays #29665
    • NullPointerException in BindingReflectionHintsRegistrar for anonymous classes #29657
    • DataBufferInputStream violates InputStream contract #29642
    • Component scanning no longer uses component index for @Named, @ManagedBean, and other Jakarta annotations #29641
    • Fix canWrite in PartHttpMessageWriter #29631
    • NoHandlerFoundException mistakenly returns request headers from ErrorResponse#getHeaders #29626
    • URI override for @HttpExchange doesn't work if there are both URI and @PathVariable method parameters #29624
    • Unnecessary parameter name introspection for constructor-arg resolution (leading to LocalVariableTableParameterNameDiscoverer warnings) #29612
    • Set detail from reason in both constructors of ResponseStatusException #29608
    • SpEL string literal misses single quotation marks in toStringAST() #29604
    • AOT code generation fails for bean of type boolean #29598
    • request-scoped bean with @Lazy fails in native image (due to missing detection of CGLIB lazy resolution proxies) #29584
    • 500 error from WebFlux when parsing Content-Type leads to InvalidMediaTypeException #29565
    • ConcurrentLruCache implementation is using too much heap memory #29520
    • Duplicate key violation gets translated to DataIntegrityViolationException instead of DuplicateKeyException in Spring 6 #29511
    • SpEL: Two double quotes are replaced by one double quote in single quoted String literal (and vice versa) #28356

    :notebook_with_decorative_cover: Documentation

    • Fix ErrorResponse#type documentation #29632
    • Fix typo in observability documentation #29590
    • Consistent documentation references to Jakarta WebSocket (2.1) #29581
    • Unrendered asciidoc headings in reference documentation #29569
    • Document observability support #29524

    :hammer: Dependency Upgrades

    ... (truncated)

    Commits
    • 0fbc94f Release v6.0.3
    • 6e08c56 Improve Javadoc for RepeatableContainers
    • fb6d3f5 Remove duplicated test code
    • 6fe5652 Support non-standard HTTP methods in FrameworkServlet
    • ca68bbc Upgrade to Reactor 2022.0.1
    • e7bcb48 Remove obsolete AttributeMethods.hasOnlyValueAttribute() method
    • 433b1c4 Support repeatable annotation containers with multiple attributes
    • 0b08246 Revise RepeatableContainersTests
    • c7bdfbe Add missing Javadoc
    • 618989d Update copyright date
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump junit-jupiter-engine from 5.7.2 to 5.9.1

    Bump junit-jupiter-engine from 5.7.2 to 5.9.1

    Bumps junit-jupiter-engine from 5.7.2 to 5.9.1.

    Release notes

    Sourced from junit-jupiter-engine's releases.

    JUnit 5.9.1 = Platform 1.9.1 + Jupiter 5.9.1 + Vintage 5.9.1

    See Release Notes.

    JUnit 5.9.0 = Platform 1.9.0 + Jupiter 5.9.0 + Vintage 5.9.0

    See Release Notes.

    JUnit 5.9.0-RC1 = Platform 1.9.0-RC1 + Jupiter 5.9.0-RC1 + Vintage 5.9.0-RC1

    See Release Notes.

    JUnit 5.9.0-M1 = Platform 1.9.0-M1 + Jupiter 5.9.0-M1 + Vintage 5.9.0-M1

    See Release Notes.

    JUnit 5.8.2 = Platform 1.8.2 + Jupiter 5.8.2 + Vintage 5.8.2

    See Release Notes.

    JUnit 5.8.1 = Platform 1.8.1 + Jupiter 5.8.1 + Vintage 5.8.1

    See Release Notes.

    JUnit 5.8.0 = Platform 1.8.0 + Jupiter 5.8.0 + Vintage 5.8.0

    See Release Notes.

    JUnit 5.8.0-RC1 = Platform 1.8.0-RC1 + Jupiter 5.8.0-RC1 + Vintage 5.8.0-RC1

    See Release Notes.

    JUnit 5.8.0-M1 = Platform 1.8.0-M1 + Jupiter 5.8.0-M1 + Vintage 5.8.0-M1

    See Release Notes.

    Commits
    • 732a540 Release 5.9.1
    • 88bf48d Prepare release notes for 5.9.1
    • d75e34d Update scope for 5.9.1
    • 9823f73 Link to all 5.9 milestone pages
    • 76719bb Increase timeout for GraalVM test
    • 2a80984 Install GraalVM for main CI build on Linux
    • 79f47f5 Refactor OpenTestReportGeneratingListener to work in native images
    • 7229385 Add failing integration test for execution on GraalVM native image
    • 343170f Fix running tests in documentation from IntelliJ IDEA
    • 352d06b Attempt to stabilize test on Windows
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Bump junit-platform-launcher from 1.7.2 to 1.9.1

    Bump junit-platform-launcher from 1.7.2 to 1.9.1

    Bumps junit-platform-launcher from 1.7.2 to 1.9.1.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 0
  • Spring endpoints not discovered, `RequestMappingInfo.patternsCondition` returns null

    Spring endpoints not discovered, `RequestMappingInfo.patternsCondition` returns null

    Setup information

    hikaku version: 3.3.0 specification converter: OpenAPI implementation converter: Spring build tool and version: Gradle 7.4.2 test framework: JUnit 5.8

    Spring Boot 2.6.6, Spring WebMVC: 5.3.18

    Describe the bug

    I've copied the test from the README, but I get this error

    👀 Expected, but unable to find:
    <list of all endpoints>
    

    https://github.com/codecentric/hikaku/blob/b8a754f91b524b53a464167bf0abd6044caa25a4/spring/src/main/kotlin/de/codecentric/hikaku/converters/spring/extensions/PathsSpringExtension.kt#L5-L7

    I've stepped through the code and I can see that patternsCondition returns null. In the Javadoc I see:

    This is mutually exclusive with {@link #getPathPatternsCondition()} such that when one returns {@code null} the other one returns an instance.

    I can see pathPatternsCondition seems to return the endpoint correctly.

    Expected behavior

    Hikaku can discover the endpoints defined in Spring

    Code samples

    The rest controllers are defined like this

    import org.springframework.http.MediaType.APPLICATION_JSON_VALUE
    import org.springframework.http.ResponseEntity
    import org.springframework.web.bind.annotation.GetMapping
    import org.springframework.web.bind.annotation.RequestMapping
    import org.springframework.web.bind.annotation.RestController
    
    @RestController
    @RequestMapping("/my-api")
    class MyRestController {
    
        @GetMapping(
            value = ["/some/endpoint"],
            produces = [APPLICATION_JSON_VALUE]
        )
        fun getDetails(
            id: String
        ): ResponseEntity<ResponseModel> {
            //...
        }
    }
    
    Bug 
    opened by aSemy 0
Releases(v3.3.0)
  • v3.3.0(Sep 2, 2021)

    Core

    • Updated kotlin to 1.5.21

    SpringConverter

    • Updated spring-webmvc to 5.3.9
    • Support all media-types for consumes (#58) | Thanks to @iazel for providing this pr

    MicronautConverter

    • Updated micronaut-http to 3.0.0

    OpenApiConverter

    • Updated swagger-parser-v3 to 2.0.27
    Source code(tar.gz)
    Source code(zip)
  • v3.2.0(Jan 25, 2021)

    Core

    • Updated kotlin to 1.4.21

    SpringConverter

    • Updated spring-webmvc to 5.3.3
    • Fixed: Regex error in regex replacement (#55) | Thanks to @mahieddine-ichir for reporting this issue

    OpenApiConverter

    • Updated swagger-parser-v3 to 2.0.24

    RamlConverter

    • Updated raml-parser-2 to 1.0.51

    MicronautConverter

    • Updated micronaut-http to 2.2.3

    JaxRsConverter

    • Updated jakarta.ws.rs-api to 3.0.0
      • This essentially changes the package from javax.ws.rs. to jakarta.ws.rs.
    Source code(tar.gz)
    Source code(zip)
  • v3.1.2(Apr 15, 2020)

    Core

    • Updated kotlin to 1.3.72

    MicronautConverter

    • Updated micronaut-http to 1.3.3

    SpringConverter

    • Updated spring-webmvc to 5.2.5.RELEASE
    • Fixed: Spring Redirect Endpoint : produces attribute not empty (#50) thanks to @drapej for reporting this issue

    OpenApiConverter

    • Updated swagger-parser-v3 to 2.0.19
    Source code(tar.gz)
    Source code(zip)
  • v3.1.1(Feb 14, 2020)

    Core

    • Updated kotlin to 1.3.61

    SpringConverter

    • Updated spring-webmvc to 5.2.3.RELEASE

    OpenApiConverter

    • Updated swagger-parser-v3 to 2.0.17

    MicronautConverter

    • Updated micronaut-http to 1.2.6

    RamlConverter

    • Updated raml-parser-2 to 1.0.48
    Source code(tar.gz)
    Source code(zip)
  • v3.1.0(Oct 23, 2019)

  • v3.0.1(Oct 18, 2019)

    Core:

    • Updated kotlin to 1.3.50

    OpenApiConverter:

    • Updated swagger-parser-v3 to 2.0.15

    MicronauConverter:

    • Updated micronaut-http to 1.2.4

    JaxRsConverter:

    • Updated jakarta.ws.rs-api to 2.1.6

    RamlConverter:

    • Updated raml-parser-2 to 1.0.41
    Source code(tar.gz)
    Source code(zip)
  • v3.0.0(Aug 8, 2019)

    Core:

    • Replaced static filtering rules in HikakuConfig with dynamic rule set using predicates. See migration guide below Thanks to @jrehwaldt for bringing up this idea in #26 and thanks a lot to @syjer for coming up with a proposal for the implementation in #44
    • Removed default values in Endpoint for httpMethod and path

    MicronautConverter:

    • Updated micronaut-http to 1.2.0

    SpringConverter:

    • Updated spring-webmvc to 5.1.9.RELEASE

    Migrating to 3.0.0

    The configuration has changed. You can now freely create rules to exclude endpoints from matching. If you've been using the HikakuConfig options here is how you can migrate to 3.0.0:

    ignoreHttpMethodHead

    If you previously used the ignoreHttpMethodHead in the config, change your config to the following: Kotlin:

    HikakuConfig(
            filter = listOf (
                    { endpoint -> endpoint.httpMethod == HEAD }
            ),
            reporter = listOf(reporter)
    )
    

    ignoreHttpMethodOptions

    If you previously used the ignoreHttpMethodOptions in the config, change your config to the following: Kotlin:

    HikakuConfig(
            filter = listOf (
                    { endpoint -> endpoint.httpMethod == OPTIONS }
            ),
            reporter = listOf(reporter)
    )
    

    ignorePaths

    If you previously used the ignorePaths in the config, change your config to the following: Kotlin:

    HikakuConfig(
            filter = listOf (
                    SpringConverter.IGNORE_ERROR_ENDPOINT,
                    { endpoint -> endpoint.path == "/other-path"},
            ),
            reporter = listOf(reporter)
    )
    

    Combined

    Of course you can combine all of these as well: Kotlin:

    HikakuConfig(
            filter = listOf (
                    { endpoint -> endpoint.httpMethod == HEAD },
                    { endpoint -> endpoint.httpMethod == OPTIONS },
                    SpringConverter.IGNORE_ERROR_ENDPOINT,
                    { endpoint -> endpoint.path == "/other-path"},
            ),
            reporter = listOf(reporter)
    )
    

    And you can create more individual rules.

    Source code(tar.gz)
    Source code(zip)
  • v2.3.0(Jul 16, 2019)

    Core:

    • Updated kotlin to 1.3.41

    Core / JaxRsConverter / MicronautConverter / OpenApiConverter / RamlConverter / SpringConverter:

    • New feature that checks the deprecation status of endpoints #40 Thanks to @uuf6429 for contributing this

    Core / JaxRsConverter / MicronautConverter:

    • ClassLocator adapted for windows systems which fixes #38

    SpringConverter:

    • Updated spring-mvc to 5.1.8.RELEASE
    • Hikaku is now able to handle endpoints using HttpServletResponse parameters which used to result in empty produces (#36 and #39) Thanks to @uuf6429 for contributing this

    MicronautConverter

    • Updated micronaut-http to 1.1.3
    • Only the base features had been activated. This has been fixed now.

    OpenApiConverter

    • Updated swagger-parser to 2.0.13
    • Added support for common parameters Thanks to @uuf6429 for contributing this
    Source code(tar.gz)
    Source code(zip)
  • v2.2.0(Jun 9, 2019)

    Core:

    • Updated kotlin to 1.3.31

    OpenApiConverter:

    • Updated swagger parser to 2.0.12

    MicronautConverter:

    • Initial creation (#34)
      • Base feature support (http method and path)
      • Support for query parameters
      • Support for path parameters
      • Support for header parameters
      • Support for consumes
      • Support for produces
    Source code(tar.gz)
    Source code(zip)
  • v2.1.1(Apr 8, 2019)

  • v2.1.0(Mar 21, 2019)

    General:

    • Added new feature MatrixParameters

    OpenApiConverter:

    • Updated swagger parser to 2.0.9

    SpringConverter:

    • Added support for matrix parameters

    WadlConverter:

    • Added support for matrix parameters

    JaxRsConverter:

    • Initial creation (#29)
      • Base feature support (http method and path)
      • Support for query parameters
      • Support for path parameters
      • Support for header parameters
      • Support for matrix parameters
      • Support for consumes
      • Support for produces
    Source code(tar.gz)
    Source code(zip)
  • v2.0.1(Mar 19, 2019)

    OpenApiConverter:

    • Fixed: Wrong file encoding leads to unclear error message (closes #27)

    RAML Converter:

    • Added missing feature activations for produces/consumes

    WadlConverter:

    • Added possibility to change charset for file in WadlConverter according to #28
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Mar 13, 2019)

    General

    • Renamed package de.codecentric.hikaku.converter to de.codecentric.hikaku.converters
    • Renamed package de.codecentric.hikaku.reporter to de.codecentric.hikaku.reporters
    • Added base features as static output to the CommandLineReporter
    • Extracted file validity check to the core and created an extension function for it
    • Added a generic EndpointConverterException. OpenApiConverter, WadlConverter and RamlConverter throw the same exception consistently

    RamlConverter

    • Initial creation
      • Base feature support (http method and path)
      • Support for query parameters
      • Support for path parameters
      • Support for header parameters
      • Support for consumes
      • Support for produces

    OpenApiConverter

    • Removed static methods usingPath() and usingFile in Java usage. Use constructors instead. For kotlin users nothing changes.
    • Fixed: Parameters referenced from components are not detected (#23)

    SpringConverter

    • Fixed: Endpoints provide default media type for 'produces' if there is no return type (#24)

    WadlConverter

    • Removed static methods usingPath() and usingFile in Java usage. Use constructors instead. For kotlin users nothing changes.
    Source code(tar.gz)
    Source code(zip)
  • v1.1.1(Mar 8, 2019)

  • v1.1.0(Feb 25, 2019)

    General:

    • Added KDoc
    • Split into separate modules
    • Added support for multiple Reporter
    • Changed granularity for the matching which leads to:
      • Only one MatchResult is being generated which differs between Endpoints that were expected, but not found and Endpoints that were not expected, but have been found.
    • Improved usage in Java instantiating the HikakuConfig

    SpringConverter:

    • Added header parameter support
    • Added support for request media types
    • Added support for response media types

    OpenApiConverter:

    • Removed constructor awaiting String, because it was misleading
    • Added header parameter support
    • Improved usage in Java by providing usingFile() and usingPath()
    • Added support for request media types
    • Added support for response media types

    WadlConverter:

    • Removed constructor awaiting String, because it was misleading
    • Added query parameter support
    • Added path parameter support
    • Added header parameter support
    • Added support for request media types
    • Added support for response media types
    • Improved usage in Java by providing usingFile() and usingPath()
    • The path won't be normalized anymore
    Source code(tar.gz)
    Source code(zip)
  • v1.0.0(Feb 1, 2019)

Owner
codecentric AG
codecentric AG
HQ OpenAPI Specification and Client & Server SDK Generators

HQ-API HQ OpenAPI Specification and Client & Server SDK Generators Cloning Github Repository Get access to Flocktory team in Github Adding a new SSH k

Flocktory Spain, S.L. 1 Sep 2, 2022
intera.kt is a Kotlin library for interacting with the Discord Interactions API through a gateway service or a REST API.

?? Overview ⚠️ WARNING: intera.kt is a work in progress. It is not yet ready for use. You may encounter bugs and other issues, but please report if yo

Pedro Henrique 1 Nov 30, 2021
intera.kt is a Kotlin library for interacting with the Discord Interactions API through a gateway service or a REST API.

?? Overview ⚠️ WARNING: intera.kt is a work in progress. It is not yet ready for use. You may encounter bugs and other issues, but please report if yo

Pedro Henrique 1 Nov 30, 2021
🧚‍♀️ Java library to interact with YouTrack's REST API.

YouTrack Kotlin API ??‍ Kotlin JVM library to interact with YouTrack's REST API. Usage fun main(args: Array<String>) { val youtrack = YouTrack {

Noel 2 Oct 1, 2021
This is a simple Rest Api for todo application

This is a simple Rest Api for todo application , where users do signup, login and add their respective todos. So this api is fully based on Ktor framework.

Jayant Pandit 8 Sep 14, 2022
API Rest With Kotlin And Spring Boot

##API REST WITH KOTLIN AND SPRING BOOT GET Url: http://localhost:8080/customers Response (Status Code: 200 Ok) { "_embedded": { "customer

Felipe Baz 0 Nov 18, 2021
Api Rest Card Game made in Kotlin with Ktor

ApiRest-CardGame "Card Game API" is a project made in Kotlin with Ktor. The API allows you to manage a simple card game deck (shuffle, take a card, pu

null 0 Dec 4, 2021
Cargo service: REST API, Spring Boot, Kotlin, JDBC, PostgreSQL

cargo-jdbc Cargo service, training project with Spring Boot, JDBC and Kotlin. To

Valeriy Emelyanov 1 Dec 7, 2022
Spring-kotlin - Learning API Rest with Kotlin, Spring and PostgreSQL

Kotlin, Spring, PostgreSQL and Liquibase Database Migrations Learning Kotlin for

Andre L S Ferreira 2 Feb 14, 2022
Katoot - An easy-to-use (blocking) Kotlin wrapper for Kahoot's REST api

katoot An easy-to-use (blocking) Kotlin wrapper for Kahoot's REST api. Usage Qui

Subham 1 Jul 17, 2022
Application for managing users by using Go REST API

UsersManagerSliide Application for managing users by using Go REST API Architecture Clean Architecture with MVVM as presentation layer Aceptance crite

Marcin Brzeczek 0 May 5, 2022
Ejemplo de API Rest Blog con Spring Boot + Kotlin + Gradle

Blog Ejemplo de API Rest Blog con Spring Boot 2.7.3 + Kotlin + Gradle + Java 17 El objetivo es que pueda servir como guía para el aprendizaje, lo más

Arturo López 6 Dec 18, 2022
Restler is a beautiful and powerful Android app for quickly testing REST API anywhere and anytime.

Restler Restler has been built with simplicity and ease of use in mind. It allows you send custom HTTP/HTTPS requests and test your REST API anywhere

Tiago 10 Dec 20, 2022
Este es un ejemplo de como usar Kotlin en un proyecto Node.js, una api rest en Node.js con Express

Kotlin Hello Node.js Este es un ejemplo de como usar Kotlin en un proyecto Node.js, una API REST con Express Kotlin Hello Node.js Acerca de Uso Compil

José Luis González Sánchez 4 Jul 16, 2022
Ejemplo de App Android con Kotlin, Jetpack Compose, Retrofit y consumo de la API REST de Pokémon

Pokémon Jetpack Compose Ejemplo de App Android con Kotlin, Jetpack Compose, Retrofit y consumo de la API REST de Pokémon Jetpack Compose Retrofit Poké

Brais Moure 70 Jan 31, 2023
An Android Image compress library, reduce's the size of the image by 90% without losing any of its pixels.

Image Compressor An Android image compress library, image compressor, is small and effective. With very little or no image quality degradation, a comp

Vinod Baste 11 Dec 23, 2022
🎓 Learning Kotlin Coroutines for Android by example. 🚀 Sample implementations for real-world Android use cases. 🛠 Unit tests included!

Kotlin Coroutines - Use Cases on Android ?? Learning Kotlin Coroutines for Android by example. ?? Sample implementations for real-world Android use ca

Lukas Lechner 2.1k Jan 3, 2023
Add screenshots to your Android tests

Testify — Android Screenshot Testing Add screenshots to your Android tests Expand your test coverage by including the View-layer. Testify allows you t

Shopify 222 Dec 26, 2022
Running Axon Server in Testcontainers tests.

Axon Server TestContainer Running axon server in testcontainers tests. Idea Run an Axon Server docker container from within your (junit) tests. Usage

holixon 3 Nov 21, 2022