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

Improve error handling #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Improve error handling #201

wants to merge 1 commit into from

Conversation

velios
Copy link

@velios velios commented Apr 27, 2024

No description provided.

@velios
Copy link
Author

velios commented Apr 27, 2024

Hello. First of all, thx for exellent lib.

I happened to be parsing someone else's API and came across this probably incorrect entry. This example with error, i know that. The problem is not that it is incorrect, but that an uninformative error was received.

Problem json part

"responses": {
          "200": {
            "description": "successful operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "profiles": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": "string",  // problem here when (keys schema) call on "string" value as schema arg
                          "depth": "number",
                          "site-id": "string"
                        },
                        "required": [
                          "id",
                          "depth"
                        ],
                        "example": "some example"
                      }
                    }
                  },
                 ...

Current exception is

#error {
 :cause nil
 :via
 [{:type java.lang.ClassCastException
   :message nil}]
 :trace
 []}

I would like to somehow improve the output for such cases, since I came across it. The wording does not stand up to criticism, I understand, so I hope that you will find the time to correct it for an understandable error.

@oliyh
Copy link
Owner

oliyh commented Apr 30, 2024

Hello!

Thank you for your contribution. I agree the existing message is not very helpful. I will hopefully find time to look at this more closely soon.

Cheers

@velios
Copy link
Author

velios commented May 2, 2024

What’s worse is that with some errors I can get an instance with partially loaded apis. Since in this case I will not receive the correct notification of problems, I will assume that my entire API has loaded.

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

Successfully merging this pull request may close these issues.

None yet

2 participants