Forum Discussion

Stoplight's avatar
Stoplight
Community Manager
2 months ago
Solved

problem+json does not require "details" or "status"

Originally posted by user jerlandsson to the Stoplight Community on 10/20/2023 at 04:03 ET.

I'm currently looking at your Zalando spectral guidelines and when I create my problem+json model I get validation errors saying that my model must have status, details and instance. However, when I look at the RFC both status and details are optional since they are stating that:

The "status" member, if present, is only advisory; it conveys the HTTP status code used for the convenience of the consumer.

And

The "detail" string, if present, ought to focus on helping the client correct the problem, rather than giving debugging information.

So I could imagine that they could give a warning or an info, but if they're not there it shouldn't throw an error.

5 Replies

    • Stoplight's avatar
      Stoplight
      Community Manager

      jerlandsson (OP) [10/24/2023 - 16:50 ET]

      Sure, I can do that, but wouldn't it be better to fix the issue so that everyone doesn't have to do that? 🙂

      • Stoplight's avatar
        Stoplight
        Community Manager

        a_welch (Staff) [10/24/2023 - 16:51 ET]

        I will certainly pass it along I just wanted to make sure you knew you adjust it as needed.

  • Stoplight's avatar
    Stoplight
    Community Manager

    jerlandsson (OP) [10/26/2023 - 02:21 ET]

    Here's a link to how Zalando did this exact change in their validator (spoiler: they made it more liberal) if you need some backing towards the devs. https://github.com/zalando/zally/issues/258

    I post it because they seem to be quite invested in problem+json