paulschneider / b247-api

0 stars 0 forks source link

Little inconsistency in property names #41

Closed pablocarrillo closed 10 years ago

pablocarrillo commented 10 years ago

when I register a user I send

{
    "email": "pablo+18@gmail.com",
    "firstname": "Pablo",
    "lastname": "Carrillo"
}

but I get:

"user": {
                "accessKey": "69275F02BC8BB7A",
                "email": "pablo+18@gmail.com",
                "firstName": "Pablo",
                "id": 24,
                "lastName": "Carrillo"
            }

Can we use always the same wording for the properties firstname and lastname?

paulschneider commented 10 years ago

Okay. Ive always used camelCase for API response var names so lets stick with that. Ive updated the validation requirements for each case where you are submitting data.

pablocarrillo commented 10 years ago

I think it is still not working ...

POST user to API
---- REQUEST ----
Method: POST uri: http://api.wf-cycle.co.uk/register
---- CLIENT HEADERS ----
{
    "Accept": "application/json", 
    "BristolAPIClient": "iphone", 
    "content-type": "application/json"
}
---- CLIENT PAYLOAD----
{
    "email": "pablo+21@gmail.com", 
    "firstName": "Pablo", 
    "lastName": "Carrillo"
}
---- RESPONSE ----
http://api.wf-cycle.co.uk/register
---- SERVER HEADERS ----
x-powered-by PHP/5.4.28
set-cookie laravel_session=eyJpdiI6IlpoNjM2cm0rU2NDWjlsXC9lVUFHVlNlekFUa1FcL0VQYzd5MlpOWm5GNmh5ST0iLCJ2YWx1ZSI6IjZDTlA1K0dnMVNLTWlpbGJTbE1LV3Z5QkJKamREY2tqMFQxNHZZUzE2c0E2WU5zNHZtRGNRVWRUTUdZa2I3SWpycW8xTVwvTUdTU3dwc2o5ZElWNGpEQT09IiwibWFjIjoiYzcyZmExMzM1YThkMzc5YTA2NmMwYTMxN2I4Y2FjMWNlYzYzZjk4OTQ2NzRlNmQwOGMwNmRiY2FjYzM0M2ZkYyJ9; expires=Fri, 18-Jul-2014 14:36:04 GMT; path=/; httponly
server Apache/2.2.27 (Unix) mod_ssl/2.2.27 OpenSSL/1.0.1e-fips mod_bwlimited/1.4 PHP/5.4.28
connection close
cache-control no-cache
date Fri, 18 Jul 2014 12:36:03 GMT
x-frame-options SAMEORIGIN
content-type text/html
---- SERVER CODE ----
500
---- SERVER PAYLOAD ----
{
    "error": {
        "file": "/home/wfcycle/public_html/api/b247-api/web/app/Version1/Users/UserRepository.php", 
        "line": 46, 
        "message": "Undefined index: firstname", 
        "type": "ErrorException"
    }
}
paulschneider commented 10 years ago

Dear me. I'm logged into 4 servers at the moment and I did a git pull on the wrong one. This should be fixed for you now. Sorry.

screen shot 2014-07-18 at 13 45 01

pablocarrillo commented 10 years ago

Perfect, thanks.