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

Record/Node Serializer and Adapter #7

Open
Glavin001 opened this issue Jul 14, 2014 · 12 comments
Open

Record/Node Serializer and Adapter #7

Glavin001 opened this issue Jul 14, 2014 · 12 comments

Comments

@Glavin001
Copy link
Member

Base off of http://emberjs.com/api/data/classes/DS.RESTSerializer.html

@Glavin001 Glavin001 self-assigned this Jul 14, 2014
@Glavin001
Copy link
Member Author

  • keyForAttribute
  • keyForRelationship

@Glavin001 Glavin001 added this to the v0.2.0 milestone Jul 14, 2014
@Glavin001
Copy link
Member Author

The SLAPIManager can act as this.

@Glavin001
Copy link
Member Author

  • createRecord
  • find
  • findQuery
  • findAll
  • findMany
  • updateRecord
  • deleteRecord

@Glavin001
Copy link
Member Author

@Glavin001
Copy link
Member Author

These are for SLSerializer not SLAPIManager.

@Glavin001
Copy link
Member Author

Changed SLAPIManager to SLAdapter.

Glavin001 added a commit that referenced this issue Jul 17, 2014
…Adapter, and Store. Unit Tests passing for Authentication and partial model-mapping, working for SLUser.
Glavin001 added a commit that referenced this issue Jul 21, 2014
Glavin001 added a commit that referenced this issue Jul 22, 2014
See #14. Improve DateTransform class.

See #7. Implement usage of DateTransform when applicable for respective AttributeType.
Use keyForAttribute to rename keys from payloads to model attribute names.
Glavin001 added a commit that referenced this issue Jul 22, 2014
@Glavin001
Copy link
Member Author

For keyForAttribute, have the base method convert the string into underscore-case: http://stackoverflow.com/a/11463782

Glavin001 added a commit that referenced this issue Jul 22, 2014
Glavin001 added a commit that referenced this issue Jul 23, 2014
Glavin001 added a commit that referenced this issue Jul 25, 2014
@Glavin001
Copy link
Member Author

findQuery is going to be very difficult because for our GET requests our query param structure is VERY non-standard with ?{/*query*/}.

See http://stackoverflow.com/a/21626123 and http://stackoverflow.com/a/21659058

Working on a possible solution by bypassing AFNetworking and using lower level HTTP request APIs... Ugh.

@Glavin001
Copy link
Member Author

2014-07-26 01:21:15.107 xctest[77821:303] urlWithParams http://localhost:5000/api/v1/attributes/?{"criteria":{"_id":{"$in":[{"$oid":"538770b42fb05c514e6cb341"},{"$oid":"53986c682fb05c52e0f5e686"}]}}}
2014-07-26 01:21:15.107 xctest[77821:303] getURL: (null)
2014-07-26 01:21:15.108 xctest[77821:303] Error: Error Domain=NSURLErrorDomain Code=-1000 "bad URL" UserInfo=0x105806c50 {NSLocalizedDescription=bad URL, NSUnderlyingError=0x100235300 "bad URL"}
2014-07-26 01:21:15.108 xctest[77821:303] Response: (null)
2014-07-26 01:21:15.109 xctest[77821:303] Error: Error Domain=NSURLErrorDomain Code=-1000 "bad URL" UserInfo=0x105806c50 {NSLocalizedDescription=bad URL, NSUnderlyingError=0x100235300 "bad URL"}
/Users/glavin/Documents/Streamlyne/cocoa-sdk/Streamlyne-iOS-SDKTests/Streamlyne_iOS_SDKTests.m:380: error: -[Streamlyne_iOS_SDKTests testFindMany] : failed - Error Domain=NSURLErrorDomain Code=-1000 "bad URL" UserInfo=0x105806c50 {NSLocalizedDescription=bad URL, NSUnderlyingError=0x100235300 "bad URL"}

Yeah this isn't going to work at all.

This simple code is failing there..

NSURL *getUrl = [NSURL URLWithString:urlWithParams];
NSLog(@"getURL: %@", getUrl);

I officially am blocked by https://github.com/Streamlyne/api-server/issues/8#issuecomment-50222861

Glavin001 added a commit that referenced this issue Jul 26, 2014
Glavin001 added a commit that referenced this issue Jul 29, 2014
See #10. Implement Store’s findQuery function.
Glavin001 added a commit that referenced this issue Jul 29, 2014
…esult in an error.

This bug was causing FindQuery requests to fail, and load all of the records (act like a FindAll without a query).
This was referenced Jul 29, 2014
Glavin001 added a commit that referenced this issue Jul 31, 2014
Glavin001 added a commit that referenced this issue Aug 11, 2014
…ting and saving AttributeDatum record works with latest API server.

TODO:
- serializeBelongsTo
- serializeHasMany
Glavin001 added a commit that referenced this issue Aug 12, 2014
…ating AttributeDatum with relationship to an existing Attribute.
@Glavin001
Copy link
Member Author

Glavin001 added a commit that referenced this issue Sep 11, 2014
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

1 participant