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

Error output is not formed correctly in Problems tab #54

Open
jeremyfiel opened this issue Oct 11, 2023 · 9 comments
Open

Error output is not formed correctly in Problems tab #54

jeremyfiel opened this issue Oct 11, 2023 · 9 comments

Comments

@jeremyfiel
Copy link

What happened?

Recently, the VS Code output is not formatted correctly. I'm not sure exactly when it started, but it seems to have been from last week.. 03/10/23+

openapi: 3.0.3
info:
  title: blah
  version: 1.1.0
paths:
  /test/api:
    get:
      parameters: 
        - name: jeremy
          in: query
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "../../../common/shared/confirm-message-schema_v03.json"
    post:
      requestBody:
        $ref: "#/components/requestBodies/jeremy"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "schemas/test-schema_v01.json"
              examples: 
                example: 
                  externalValue: "./examples/example.json"
                example1:
                  $ref: "./not-schemas/test-schema_v01.json"
components:
  requestBodies:
    jeremy:
      required: true
      content:
        application/json:
          schema:
            $ref: "./common/shared/-schema_v01.json"
  schemas:
    jeremy:
      type: object
      properties:
        test:
          $ref: "jeremy-test"

Screenshots

two diff examples of output from different files.

image
image

Additional context

Last released
2023-9-20, 10:16:31
Last updated
2023-9-20, 20:18:54
@jeremyfiel
Copy link
Author

I found a configurable rule is causing this behavior

  rule/header-param-exists:
    subject:
      type: Parameter
      property: in
    where:
      - subject:
          type: Operation
          property: parameters
        assertions:
          defined: true
    assertions:
      const: header

I was playing around with trying to find a solution to Redocly/redocly-cli#1286

@tatomyr
Copy link
Contributor

tatomyr commented Oct 16, 2023

Thank you @jeremyfiel for reporting this!

@tatomyr tatomyr added the p3 label Oct 16, 2023
@RomanHotsiy
Copy link
Member

@jeremyfiel so if you remove the configurable rule the formatting gets back to normal?

@jeremyfiel
Copy link
Author

Yes, something with the reporting and the way this rule is written causes the invalid output

@jeremyfiel
Copy link
Author

@RomanHotsiy I found this happens again with this new rule I was testing:

The formatting issue seems to be in both VSC and the cli output

rules:
  rule/operation-tags-must-be-defined:
  severity: error
  subject:
    type: Operation
  assertions:
    required:
      - tags

image

image

@jeremyfiel
Copy link
Author

@RomanHotsiy @tatomyr

I think I found the root cause of this formatting error. If I omit message in the configurable rule, it creates this formatting error.

@tatomyr
Copy link
Contributor

tatomyr commented Jan 19, 2024

@jeremyfiel I think it has something to do with OS. On Mac I get correct problems' output formatting:
Screenshot 2024-01-19 at 20 19 14

Do you use Windows?

@jeremyfiel
Copy link
Author

I do use windows. But if you remove the message property it doesn't give you incorrect formatting?

@tatomyr
Copy link
Contributor

tatomyr commented Jan 19, 2024

Yes, this is without the message property.

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

No branches or pull requests

3 participants