citrusframework / citrus

Framework for automated integration tests with focus on messaging integration
https://citrusframework.org
Apache License 2.0
460 stars 137 forks source link

Issue/1175/improve open api final 2 #1224

Open tschlat opened 1 month ago

tschlat commented 1 month ago

This is the final PR for the new OpenAPI feature.

I apologize for the large size of this PR. It includes the following major changes:

  1. Updates to the OpenAPI Connector:

    • Improved test coverage.
    • Replaced validation using "Citrus Control Message" with OAS schema validation based on the Atlassian OpenAPI Validator framework. (This is quite a drastical change and I would appreciate Christophs Feedback on this). I am pretty sure that this is breaking, as the OpenAPI Validator might be stricter than the previous implementation.
    • Enhanced random message generation capabilities and test coverage
  2. Revised Implementation of TestAPI Generator:

    • Now uses the Citrus Builder Pattern.
    • Added extensive tests to verify the generated test API against various aspects of OpenAPI.
    • Introduced multipartmessage support.
    • Included support for all different types of parameter serialization.
    • Added an initial implementation of a SOAP Test API generator. While the benefits of this API are somewhat limited, it becomes useful when OpenAPI and SOAP are used together, as both service types can now be handled in a consistent way. Note: the SOAP Test API is in an early stage, with basic functionality and limited testing.
    • org.citrusframework.openapi.generator.GeneratedRestApiIT gives an overview on how to use the generated REST API
    • org.citrusframework.openapi.generator.GeneratedSoapApiIT same for SOAP although only very little, yet
  3. Enhanced Server-Side Header Validation for Parameter Serialization:

    • Improved header validation to support arrays of parameters, particularly focusing on different aspects of array-type parameter serialization.
    • see org.citrusframework.http.message.HttpQueryParamHeaderValidator for details
bbortt commented 4 weeks ago

once done, the copyright headers should be re-applied to all *.java files.

bbortt commented 3 weeks ago

found the last ci/cd bug. it was actually a case-sensitivity problem, which didn't occur on windows. we should expect to see a green build.

tschlat commented 3 weeks ago

@ueberfuhr - as a user of the current OpenAPI feature, i would be interested in your feedback on this new feature. Especially in the context of OAS validation, which might be breaking, once we merge this MR (see MR description for details). I advise to check this class that tests all aspects of the generated API.

org.citrusframework.openapi.generator.GeneratedRestApiIT