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

mpOpenAPI-4.0: implement validation #29687

Merged
merged 8 commits into from
Sep 27, 2024

Commits on Sep 20, 2024

  1. Move OpenAPI validation unit tests

    So that they can be shared with MP OpenAPI 4.0
    
    Also add a validation result matcher so we get better test failure
    messages.
    Azquelt committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    e07ca42 View commit details
    Browse the repository at this point in the history
  2. Make existing OpenAPI validation FATs fail faster

    Once the app has been deployed, we expect the messages to have been
    logged, so we don't need to wait for them. This has no effect if the
    test passes, but makes it run much more quickly if the expected messages
    are not emitted.
    Azquelt committed Sep 20, 2024
    Configuration menu
    Copy the full SHA
    338bf2d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0f1fa31 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2024

  1. mpOpenAPI-4.0: Implement OpenAPI v3.1 validation

    OpenAPI 3.1 is fairly similar to 3.0, so we re-use a lot of the same
    validation logic.
    
    As well as adding the new rules, we needed to:
    - refactor reference validation, as references need to be validated
      differently
    - Change how we select which validator to use so that its based on the
      OpenAPI version specified in the document rather than on which version
      of the feature is running (ensuring mpOpenAPI-4.0 can still validate
      OpenAPI v3.0 documents if the user has requested that)
    - Make the 3.0 Schema validation code work with the mpOpenAPI-4.0 data
      model which has breaking API changes. The 3.0 validation needs to work
      with all versions of the model.
    Azquelt committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    f92272e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a2d1723 View commit details
    Browse the repository at this point in the history
  3. MP OpenAPI: Add test for validation message output

    We were testing for each of the problem messages we expect, but we
    weren't testing for the top message which says "The following errors
    were found:"
    Azquelt committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    feb0a48 View commit details
    Browse the repository at this point in the history
  4. mpOpenAPI-4.0: OpenAPI v3.1 validation FAT tests

    Copy the existing OpenAPI v3.0 validation FAT tests and adjust them for
    the new validation rules in v3.1 and run them against OpenAPI v3.1
    documents.
    Azquelt committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    a0a56f0 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    912b38a View commit details
    Browse the repository at this point in the history