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

Open
wants to merge 7 commits into
base: integration
Choose a base branch
from

Conversation

Azquelt
Copy link
Member

@Azquelt Azquelt commented Sep 20, 2024

Fixes #28860

@LibbyBot
Copy link

The following files contain a string indicating discriminating content:

  • dev/io.openliberty.microprofile.openapi.4.0.internal_fat/fat/src/io/openliberty/microprofile/openapi40/fat/validation/validation4.yml

@Azquelt Azquelt force-pushed the mpopenapi-40-validation branch 2 times, most recently from 080a2fd to d240017 Compare September 20, 2024 12:56
So that they can be shared with MP OpenAPI 4.0

Also add a validation result matcher so we get better test failure
messages.
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.
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.
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 Azquelt force-pushed the mpopenapi-40-validation branch 2 times, most recently from 0b57e23 to ae9f366 Compare September 20, 2024 15:12
@Azquelt
Copy link
Member Author

Azquelt commented Sep 20, 2024

#libby

@Azquelt
Copy link
Member Author

Azquelt commented Sep 20, 2024

#build
#spawn.fullfat.buckets=com.ibm.ws.microprofile.openapi.1.1_fat_tck,com.ibm.ws.microprofile.openapi_fat,com.ibm.ws.microprofile.openapi_fat_tck,com.ibm.ws.openapi.ui_fat,io.openliberty.microprofile.openapi.2.0.internal_fat,io.openliberty.microprofile.openapi.2.0.internal_fat_tck,io.openliberty.microprofile.openapi.3.0.internal_fat_tck,io.openliberty.microprofile.openapi.3.1.internal_fat_tck,io.openliberty.microprofile.openapi.4.0.internal_fat,io.openliberty.microprofile.openapi.4.0.internal_fat_tck,io.openliberty.microprofile.openapi.ui.internal_fat

@LibbyBot
Copy link

Your personal pipeline request is at https://libh-proxy1.fyre.ibm.com/cognitive/pipelineAnalysis.html?uuid=15a75c78-d991-42a3-9ea1-23a141218539

Target locations of links might be accessible only to IBM employees.

@Azquelt
Copy link
Member Author

Azquelt commented Sep 20, 2024

The following files contain a string indicating discriminating content:

This should now be fixed.

@LibbyBot
Copy link

Code analysis and actions

DO NOT DELETE THIS COMMENT.
  • 38 product code files were changed.

  • Please describe in a separate comment how you tested your changes.

  • 29 FAT files were changed, added, or removed.

  • Check that the build did not break the affected FAT suite(s).

  • 37 unit test files were changed.

  • Check that the build did not break the affected unit test suite(s).

  • 1 messages files were changed and need an L2 review.

  • @OpenLiberty/message-reviewer Please review.

  • dev/io.openliberty.microprofile.openapi.internal.common/resources/io/openliberty/microprofile/openapi/internal/resources/validation/ValidationMessages.nlsprops

  • 1 NLS files were changed and need an ID review.

  • @OpenLiberty/message-reviewer Please review.

  • dev/io.openliberty.microprofile.openapi.internal.common/resources/io/openliberty/microprofile/openapi/internal/resources/validation/ValidationMessages.nlsprops

@LibbyBot
Copy link

Your personal build request is at https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_erroUHdgEe-ZBdXWdK7Miw

Target locations of links might be accessible only to IBM employees.

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.
@LibbyBot
Copy link

@LibbyBot
Copy link

The build Azquelt-29687-20240920-1602
https://wasrtc.hursley.ibm.com:9443/jazz/resource/itemOid/com.ibm.team.build.BuildResult/_erroUHdgEe-ZBdXWdK7Miw
completed and has errors or failures.

For help analyzing your personal build, go to https://libh-proxy1.fyre.ibm.com/cognitive/buildAnalysis.html?uuid=_erroUHdgEe-ZBdXWdK7Miw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement OpenAPI document validation on MP OpenAPI 4.0
2 participants