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

Warn about targets not matching any OpenAPI operation #391

Closed
Kallys opened this issue Aug 10, 2022 · 5 comments
Closed

Warn about targets not matching any OpenAPI operation #391

Kallys opened this issue Aug 10, 2022 · 5 comments
Assignees
Labels
new feature New potential functionality

Comments

@Kallys
Copy link

Kallys commented Aug 10, 2022

Hi!

It would be great if portman can show a warning when a target did not match any OpenAPI operation.
My use case is a big openapi definition split in multiple files, if someone in my team renames an operation id and forget to update portman configuration, associated tests will silently disapears.

Let's say for example someone rename operation getProducts to getAllProducts in OpenApi but config remains:

--
version: 1
tests:
  contentTests:
    - openApiOperationId: getProducts
      responseBodyTests:
        - key: 'products'
          minLength: 1
[...]

This content test will silently disapear from generated postman collection (which is, I think, dangerous).

@nicklloyd
Copy link
Contributor

👍🏻 I like this idea - we could look at adding a config validation layer that could validate for this, and potentially other config issues.

@thim81 thim81 added the new feature New potential functionality label Aug 11, 2022
@thim81
Copy link
Collaborator

thim81 commented Aug 19, 2024

linked to #632

@thim81
Copy link
Collaborator

thim81 commented Sep 28, 2024

hi @Kallys @nicklloyd
Would this be something you had in mind for the warning?
image

Question: what would be the default? That this warning is displayed or only when the --warn parameter is included?

@thim81 thim81 self-assigned this Sep 28, 2024
@Kallys
Copy link
Author

Kallys commented Sep 30, 2024

As far as I remember, this sounds great!
I would suggest producing warnings by default to stderr.
And either, providing a verbosity level adjustment option like --verbose=warn (by default) and a --verbose=error to disable warnings or a file redirection option like --warn=/dev/null (to disable warnings) or --warn=/path/to/warn.log.
This will help shell scripting for CI jobs.

@thim81
Copy link
Collaborator

thim81 commented Nov 1, 2024

hi @Kallys,

We just released version 1.30.5 of Portman, which includes the warning when a target does not exist in the OpenAPI spec.
Currently it only outputs the warning using console.log, so I'm not sure what would be the correct way to be used in CI jobs?

If you have suggestions to improvements, let us know in the discussions or open a new issue for it.

Closing this item, since a 1st version is released.

@thim81 thim81 closed this as completed Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New potential functionality
Projects
None yet
Development

No branches or pull requests

3 participants