dunglas / vulcain

🔨 Fast and idiomatic client-driven REST APIs.
https://vulcain.rocks
GNU Affero General Public License v3.0
3.51k stars 106 forks source link

Regression since 0.4.1 #102

Closed bpolaszek closed 1 year ago

bpolaszek commented 1 year ago

Hello,

I upgraded Caddy on my staging env yesterday (using xcaddy --with github.com/dunglas/vulcain/caddy) and observed that responses from unchanged requests are now broken.

Request (basically, fetch + preload all IRIs of an Hydra Collection):

GET /api/books
fields: "@type", "/hydra:member/*/@id", "/hydra:totalItems"
preload: "/hydra:member/*/@id"

Produced (using v0.0.0-20220906084821-705c1113298e built on Sept 27, 2022):

{
  "hydra:member": [
    {
      "@id": "\/api\/books\/01FT5VZY5HPGXGTJFMERMZ8E01"
    }
  ],
  "@type": "hydra:Collection",
  "hydra:totalItems": 1
}

Now(v0.4.1):

{
  "hydra:member": [
    {}
  ],
  "hydra:totalItems": 1
}

Did something changed I'm not aware of? I couldn't find any info in the changelog nor in the documentation. At first glance it just looks like Vulcain doesn't like @ properties anymore.

Thanks, Ben

dunglas commented 1 year ago

Could you check which version of sjson you use? This looks similar to https://github.com/tidwall/sjson/issues/66

bpolaszek commented 1 year ago
./caddy list-modules --versions | grep sjson

returns nothing - where am I supposed to find that information?

dunglas commented 1 year ago

In your go.sum file.