Comments (5)
Ah yes - looks like this is a hangover from changes made in
#11.
I've added this to today's milestone:
https://github.com/pythondave/th-admin/issues?milestone=1
On 9 July 2013 13:09, villarin [email protected] wrote:
API method:
http://pythondave.github.io/th-admin/2/0.4/scaffolding/api/default.html#/job/0The jobId parameter is not been sent to the api method - an array of
arrays is been sent instead i.e jobid[jobid].—
Reply to this email directly or view it on GitHubhttps://github.com//issues/19
.
from th-admin.
Otto
I'm thinking of tweaking something in relation to this, and would appreciate your thoughts.
For the API calls, I previously both used and passed to you the following (for example):
A1: { jobId: 123 }
B1: { search: "t", statusId: 1, limit: 5 }
C1: { jobId: 123, statusIds: [ 2, 4, 5, 6, 7, 8 ] }
D1: { search: "te", statusId: 1, limit: 5, exclude: { jobId: 123 }}
I changed this (in #11) so I keep the above, but $.param is always applied before I pass them to you. You currently therefore get passed the following (I'm using 'you' as a synonym for 'the server' :) :
A2: jobId=123 (ignoring the jobid[jobid] bug - i.e. this bug)
B2: search=t&statusId=1&limit=5
C2: jobId=123&statusIds%5B%5D=2&statusIds%5B%5D=4&statusIds%5B%5D=5&statusIds%5B%5D=6&statusIds%5B%5D=7&statusIds%5B%5D=8
D2: search=te&statusId=1&limit=5&exclude%5BjobId%5D=123
A and B are typical of most requests and I think/assume are fine. C and D are less typical and don't feel right - I don't know whether you'd yet noticed these.
I'm wondering if we could have an API design rule along the lines of: Rule D - "only simple objects are ever used in get requests" (as in A1 and B1, but not as in C1 and D1).
Before that, here's my related question to you...
Q1: I think the best way forwards is for you to specify what you want to be passed for C2 and D2 (i.e. for http://localhost/th-admin/2/0.4/scaffolding/api/default.html#/applications/1 and http://localhost/th-admin/2/0.4/scaffolding/api/default.html#/teachers/4).
[
In essence, I'm wondering whether I can keep $.param only and change C1 and D1 to something like:
C1: { jobId: 123, statusIds: "2,4,5,6,7,8" }
D1: { search: "te", statusId: 1, limit: 5, excludeJobId: 123 }
...which will mean C2 and D2 automatically become:
C2: jobId=123&statusIds=2,4,5,6,7,8
D2: search=te&statusId=1&limit=5&excludeJobId=123
...but my options depend on your answer to Q1 :)
]
from th-admin.
Q1: I think the best way forwards is for you to specify what you want to be
passed for C2 and D2 (i.e. for
http://localhost/th-admin/2/0.4/scaffolding/api/default.html#/applications/1
and
http://localhost/th-admin/2/0.4/scaffolding/api/default.html#/teachers/4).
In essence, I'm wondering whether I can keep $.param only and change C1 and
D1 to something like:
C1: { jobId: 123, statusIds: "2,4,5,6,7,8" }
D1: { search: "te", statusId: 1, limit: 5, excludeJobId: 123 }
Yeap that is perfectly fine - but please keep the statuses as one single
variable - OR basically
C1: { jobId: 123, statusIds: "2,4,5,6,7,8" }
D1: { search: "te", statusIds: "1", limit: 5, excludeJobId: 123 }
That saves an additional request parameter to sanitise and maintain on the
backend...
from th-admin.
Good stuff - thanks!
Let's go for the 2nd option :)
On 10 July 2013 15:01, villarin [email protected] wrote:
Q1: I think the best way forwards is for you to specify what you want to be
passed for C2 and D2 (i.e. forhttp://localhost/th-admin/2/0.4/scaffolding/api/default.html#/applications/1
and
http://localhost/th-admin/2/0.4/scaffolding/api/default.html#/teachers/4).In essence, I'm wondering whether I can keep $.param only and change C1 and
D1 to something like:C1: { jobId: 123, statusIds: "2,4,5,6,7,8" }
D1: { search: "te", statusId: 1, limit: 5, excludeJobId: 123 }Yeap that is perfectly fine - but please keep the statuses as one single
variable - OR basicallyC1: { jobId: 123, statusIds: "2,4,5,6,7,8" }
D1: { search: "te", statusIds: "1", limit: 5, excludeJobId: 123 }That saves an additional request parameter to sanitise and maintain on the
backend...—
Reply to this email directly or view it on GitHubhttps://github.com//issues/19#issuecomment-20743859
.
from th-admin.
Fixed this exact issue and implemented the '2nd option'.
In addition, I added something to the API viewer which shows the 'serialized query data', to make it more obvious what's being sent to the server.
from th-admin.
Related Issues (20)
- API - teachers - Teachers pending approval - i.e. candidates to review HOT 1
- API tweak - teachers - get an array of teachers matching certain text strings + other criteria HOT 1
- API tweak - process-application - sending a message HOT 2
- Have the mock server flag when a request doesn't match anything in the API viewer
- Have a way to explicitly see which API requests are involved in a particular use case
- Have a way to be able to see the *structure* of a response
- Update working processes 'docs' to include an API cycle HOT 1
- Encoding issue when requesting teacher list HOT 3
- Handling unauthorized requests HOT 2
- Cover note hover functionality breaks if it contains single quote HOT 4
- Jobs page - filters - undefined refines are being displayed HOT 2
- Process enhancement - set up simple testing and add a single test
- Process enhancement - research potential improvements to the deployment process
- Introduce different api method for applications data requirement in the job overview screen HOT 11
- Deprecate school names api method HOT 7
- Create version 0.1 of API design rules / guidelines
- Job overview screen - message when no applications has been put forward HOT 2
- Admin note posted to incorrect url HOT 5
- Approaches for developing new public access web pages
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from th-admin.