Use the same serializer for all contact related actions

Also, rerun the response with an RFC4627 formatter
This commit is contained in:
Maciej Szlosarczyk 2018-11-01 23:06:27 +02:00
parent 2a7b6c1eb8
commit 94efbbbab0
No known key found for this signature in database
GPG key ID: 41D62D42D3B0D765
5 changed files with 146 additions and 105 deletions

View file

@ -23,39 +23,32 @@ HTTP/1.1 200
Content-Type: application/json
{
"contacts": [
"contacts":[
{
"uuid": "84c62f3d-e56f-40fa-9ca4-dc0137778949",
"domain_names": ["example.com"],
"code": "REGISTRAR2:SH022086480",
"phone": "+372.12345678",
"email": "hoyt@deckowbechtelar.net",
"fax": null,
"created_at": "2015-09-09T09:11:14.130Z",
"updated_at": "2015-09-09T09:11:14.130Z",
"ident": "37605030299",
"ident_type": "priv",
"auth_info": "password",
"name": "Karson Kessler0",
"org_name": null,
"registrar_id": 2,
"creator_str": null,
"updator_str": null,
"ident_country_code": "EE",
"city": "Tallinn",
"street": "Short street 11",
"zip": "11111",
"country_code": "EE",
"state": null,
"legacy_id": null,
"statuses": [
"id":"84c62f3d-e56f-40fa-9ca4-dc0137778949",
"name":"Karson Kessler",
"code":"REGISTRAR2:SH022086480",
"ident":{
"code":"37605030299",
"type":"priv",
"country_code":"EE"
},
"email":"foo@bar.baz",
"phone":"+372.12345671",
"fax":"+372.12345672",
"address":{
"street":"Main Street 123",
"zip":"22222",
"city":"New City",
"state":"New state",
"country_code":"LV"
},
"auth_info":"password",
"statuses":[
"ok"
],
"status_notes": {
}
]
}
],
"total_number_of_records": 2
]
}
```
@ -77,33 +70,28 @@ HTTP/1.1 200
Content-Type: application/json
{
"uuid": "84c62f3d-e56f-40fa-9ca4-dc0137778949",
"domain_names": ["example.com"],
"id": "84c62f3d-e56f-40fa-9ca4-dc0137778949",
"name": "Karson Kessler",
"code": "REGISTRAR2:SH022086480",
"phone": "+372.12345678",
"email": "hoyt@deckowbechtelar.net",
"fax": null,
"created_at": "2015-09-09T09:11:14.130Z",
"updated_at": "2015-09-09T09:11:14.130Z",
"ident": "37605030299",
"ident_type": "priv",
"ident": {
"code": "37605030299",
"type": "priv",
"country_code": "EE"
},
"email": "foo@bar.baz",
"phone": "+372.12345671",
"fax": "+372.12345672",
"address": {
"street": "Main Street 123",
"zip": "22222",
"city": "New City",
"state": "New state",
"country_code": "LV"
},
"auth_info": "password",
"name": "Karson Kessler0",
"org_name": null,
"registrar_id": 2,
"creator_str": null,
"updator_str": null,
"ident_country_code": "EE",
"city": "Tallinn",
"street": "Short street 11",
"zip": "11111",
"country_code": "EE",
"state": null,
"legacy_id": null,
"statuses": [
"ok"
],
"status_notes": {}
]
}
```
@ -134,16 +122,16 @@ Accept: application/json
Content-type: application/json
{
"name": "John Doe",
"email": "foo@bar.baz",
"phone": "+372.12345671",
"fax": "+372.12345672",
"address": {
"street": "Main Street 123",
"zip": "22222",
"city": "New City",
"state": "New state",
"country_code": "LV"
"name":"John Doe",
"email":"foo@bar.baz",
"phone":"+372.12345671",
"fax":"+372.12345672",
"address":{
"street":"Main Street 123",
"zip":"22222",
"city":"New City",
"state":"New state",
"country_code":"LV"
}
}
@ -155,26 +143,26 @@ HTTP/1.1 200
Content-Type: application/json
{
"id": "84c62f3d-e56f-40fa-9ca4-dc0137778949",
"name": "Karson Kessler0",
"code": "REGISTRAR2:SH022086480",
"ident": {
"code": "37605030299",
"type": "priv",
"country_code": "EE"
"id":"84c62f3d-e56f-40fa-9ca4-dc0137778949",
"name":"Karson Kessler",
"code":"REGISTRAR2:SH022086480",
"ident":{
"code":"37605030299",
"type":"priv",
"country_code":"EE"
},
"email": "foo@bar.baz",
"phone": "+372.12345671",
"fax": "+372.12345672",
"address": {
"street": "Main Street 123",
"zip": "22222",
"city": "New City",
"state": "New state",
"country_code": "LV"
"email":"foo@bar.baz",
"phone":"+372.12345671",
"fax":"+372.12345672",
"address":{
"street":"Main Street 123",
"zip":"22222",
"city":"New City",
"state":"New state",
"country_code":"LV"
},
"auth_info": "password",
"statuses": [
"auth_info":"password",
"statuses":[
"ok"
]
}
@ -186,8 +174,10 @@ HTTP/1.1 400
Content-Type: application/json
{
"errors": {
"phone": ["Phone nr is invalid"]
"errors":{
"phone":[
"Phone nr is invalid"
]
}
}
```