json-api-dart icon indicating copy to clipboard operation
json-api-dart copied to clipboard

Update http deps to use v1.x.x

Open TatsuUkraine opened this issue 2 years ago • 8 comments

Currently json api package requires http v0.13.x. Most up to date version of http package is v1.1.0.

TatsuUkraine avatar Aug 15 '23 16:08 TatsuUkraine

@f3ath, when can we expect a bump in the http package version? Because many different packages with new flutter have constraints on ^1.x.x for http package.

aliaksei-liavonik avatar Sep 07 '23 08:09 aliaksei-liavonik

Hey folks. I just released v6. Please give it a shot. This package is now decoupled from the particular client/server implementation via http_interop which does support http v1. I am also planning to add a wrapper for dio. It's a bit more complicated to set up, please take a look at the example: https://github.com/f3ath/json-api-dart/blob/6.0.0/example/client.dart

Please LMK what you think.

f3ath avatar Sep 08 '23 07:09 f3ath

@f3ath thank you for the update. I just played with v6 a little bit, and it seems NewRelationship type is not exported

TatsuUkraine avatar Sep 11 '23 19:09 TatsuUkraine

also, it would be cool to have contructor for NewIdentifier or any other object, where you can create Idetifier with just type but without id and lid. But if it's goes against the docs, then ok)

TatsuUkraine avatar Sep 11 '23 19:09 TatsuUkraine

Thanks for the feedback. I hope to address the issues sometime this week. You're more than welcome to open a PR too.

f3ath avatar Sep 11 '23 20:09 f3ath

also, it would be cool to have contructor for NewIdentifier or any other object, where you can create Idetifier with just type but without id and lid. But if it's goes against the docs, then ok)

This would indeed contradict the standard as per

A “resource identifier object” MUST contain a type member. It MUST also contain an id member, except when it represents a new resource to be created on the server. In this case, a lid member MUST be included that identifies the new resource.

What's the use case for that, @TatsuUkraine?

f3ath avatar Sep 12 '23 02:09 f3ath

Docs also have this definition .

Every resource object MUST also contain an id member, except when the resource object originates at the client and represents a new resource to be created on the server. If id is omitted due to this exception, a lid member MAY be included to uniquely identify the resource by type locally within the document

Which is a little bit confusing, since one section says it's required, and another - that it's optional)

TatsuUkraine avatar Sep 12 '23 10:09 TatsuUkraine

Actually, nvm, Identifier is for relationships, and the link in my last message was about the resource ) sorry for confusion

TatsuUkraine avatar Sep 12 '23 10:09 TatsuUkraine

Any updates for this issue? Most packages are now updated to http: ^1.1.x, making this a bottleneck.

daniloapr avatar May 31 '24 02:05 daniloapr

@daniloapr Does version 7.0 not solve the issue with http 1.1? The http_interop is intended to be a solution for this kind of troubles, it requires a bit more boilerplate/init code but should make the dependency management easier.

f3ath avatar May 31 '24 02:05 f3ath

The json_api was actually used by another library that my project imports, which uses the version 7.0.0. It was showing the http conflict, but after I forked the library and set the fixed the version, it worked. Thank you for the response!

daniloapr avatar Jun 03 '24 19:06 daniloapr