update other schemas to include embeddable attrs
This commit is contained in:
parent
139963e533
commit
c4509fd054
4 changed files with 69 additions and 1 deletions
|
@ -27,8 +27,14 @@
|
||||||
"map_id": {
|
"map_id": {
|
||||||
"$ref": "_id.json"
|
"$ref": "_id.json"
|
||||||
},
|
},
|
||||||
|
"map": {
|
||||||
|
"$ref": "_map.json"
|
||||||
|
},
|
||||||
"user_id": {
|
"user_id": {
|
||||||
"$ref": "_id.json"
|
"$ref": "_id.json"
|
||||||
|
},
|
||||||
|
"user": {
|
||||||
|
"$ref": "_user.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -37,5 +43,19 @@
|
||||||
"mappable_type",
|
"mappable_type",
|
||||||
"created_at",
|
"created_at",
|
||||||
"updated_at"
|
"updated_at"
|
||||||
|
],
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"oneOf": [
|
||||||
|
{ "required": [ "map_id" ] },
|
||||||
|
{ "required": [ "map" ] }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"oneOf": [
|
||||||
|
{ "required": [ "user_id" ] },
|
||||||
|
{ "required": [ "user" ] }
|
||||||
|
]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,11 +24,20 @@
|
||||||
"topic1_id": {
|
"topic1_id": {
|
||||||
"$ref": "_id.json"
|
"$ref": "_id.json"
|
||||||
},
|
},
|
||||||
|
"topic1": {
|
||||||
|
"$ref": "_topic.json"
|
||||||
|
},
|
||||||
"topic2_id": {
|
"topic2_id": {
|
||||||
"$ref": "_id.json"
|
"$ref": "_id.json"
|
||||||
},
|
},
|
||||||
|
"topic2": {
|
||||||
|
"$ref": "_topic.json"
|
||||||
|
},
|
||||||
"user_id": {
|
"user_id": {
|
||||||
"$ref": "_id.json"
|
"$ref": "_id.json"
|
||||||
|
},
|
||||||
|
"user": {
|
||||||
|
"$ref": "_user.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -38,5 +47,25 @@
|
||||||
"permission",
|
"permission",
|
||||||
"created_at",
|
"created_at",
|
||||||
"updated_at"
|
"updated_at"
|
||||||
|
],
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"oneOf": [
|
||||||
|
{ "required": [ "topic1_id" ] },
|
||||||
|
{ "required": [ "topic1" ] }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"oneOf": [
|
||||||
|
{ "required": [ "topic2_id" ] },
|
||||||
|
{ "required": [ "topic2" ] }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"oneOf": [
|
||||||
|
{ "required": [ "user_id" ] },
|
||||||
|
{ "required": [ "user" ] }
|
||||||
|
]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,14 @@
|
||||||
"user_id": {
|
"user_id": {
|
||||||
"$ref": "_id.json"
|
"$ref": "_id.json"
|
||||||
},
|
},
|
||||||
|
"user": {
|
||||||
|
"$ref": "_user.json"
|
||||||
|
},
|
||||||
"metacode_id": {
|
"metacode_id": {
|
||||||
"$ref": "_id.json"
|
"$ref": "_id.json"
|
||||||
|
},
|
||||||
|
"metacode": {
|
||||||
|
"$ref": "_metacode.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
@ -39,5 +45,19 @@
|
||||||
"permission",
|
"permission",
|
||||||
"created_at",
|
"created_at",
|
||||||
"updated_at"
|
"updated_at"
|
||||||
|
],
|
||||||
|
"allOf": [
|
||||||
|
{
|
||||||
|
"oneOf": [
|
||||||
|
{ "required": [ "user_id" ] },
|
||||||
|
{ "required": [ "user" ] }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"oneOf": [
|
||||||
|
{ "required": [ "metacode_id" ] },
|
||||||
|
{ "required": [ "metacode" ] }
|
||||||
|
]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,6 @@ RSpec.describe 'maps API', type: :request do
|
||||||
post "/api/v2/maps/#{map.id}/stars", params: { access_token: token }
|
post "/api/v2/maps/#{map.id}/stars", params: { access_token: token }
|
||||||
expect(response).to have_http_status(:success)
|
expect(response).to have_http_status(:success)
|
||||||
expect(response).to match_json_schema(:map)
|
expect(response).to match_json_schema(:map)
|
||||||
expect(response).to match_json_schema(:map_starred)
|
|
||||||
expect(user.stars.count).to eq 1
|
expect(user.stars.count).to eq 1
|
||||||
expect(map.stars.count).to eq 1
|
expect(map.stars.count).to eq 1
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue