forest-express
Advanced tools
Comparing version 10.0.0 to 10.0.1
@@ -29,3 +29,3 @@ "use strict"; | ||
var needsDateOnlyFormating = Implementation.getLianaName() === 'forest-express-sequelize' && semver.lt(Implementation.getOrmVersion(), '4.0.0'); | ||
var reservedWords = ['meta']; | ||
var reservedWords = ['meta', 'attributes']; | ||
var fieldInfoDateonly = []; | ||
@@ -32,0 +32,0 @@ var fieldInfoPoint = []; |
{ | ||
"name": "forest-express", | ||
"description": "Official package for all Forest Express Lianas", | ||
"version": "10.0.0", | ||
"version": "10.0.1", | ||
"author": "Sandro Munda <sandro@munda.me>", | ||
@@ -6,0 +6,0 @@ "contributors": [ |
@@ -57,2 +57,25 @@ module.exports = { | ||
}, { | ||
field: 'attributes', | ||
type: { | ||
fields: [{ | ||
field: 'option', | ||
type: 'String', | ||
}, { | ||
field: 'color', | ||
type: 'String', | ||
}], | ||
}, | ||
defaultValue: null, | ||
enums: null, | ||
integration: null, | ||
isFilterable: true, | ||
isPrimaryKey: false, | ||
isReadOnly: false, | ||
isRequired: false, | ||
isSortable: true, | ||
isVirtual: false, | ||
reference: null, | ||
inverseOf: null, | ||
validations: [], | ||
}, { | ||
field: 'name', | ||
@@ -59,0 +82,0 @@ type: 'String', |
@@ -64,2 +64,36 @@ const ResourceSerializer = require('../../src/serializers/resource'); | ||
it('should serialize the fields with a nested model named "attributes"', async () => { | ||
const records = [ | ||
{ | ||
_id: '5fbfb0ee67e7953f9b8414bf', | ||
name: 'Zoey', | ||
attributes: { | ||
color: 'red', | ||
option: 'air conditioning', | ||
}, | ||
}, { | ||
_id: '5f928f4f1eedcfbce937bbd0', | ||
name: 'Ibiza', | ||
}]; | ||
const serialized = await getSerializer(records).perform(); | ||
expect(serialized).toStrictEqual({ | ||
data: [{ | ||
attributes: { | ||
_id: '5fbfb0ee67e7953f9b8414bf', | ||
attributes: { color: 'red', option: 'air conditioning' }, | ||
name: 'Zoey', | ||
}, | ||
type: 'cars', | ||
}, { | ||
attributes: { | ||
_id: '5f928f4f1eedcfbce937bbd0', | ||
name: 'Ibiza', | ||
}, | ||
type: 'cars', | ||
}], | ||
}); | ||
}); | ||
it('should not add attribute when their are undefined', async () => { | ||
@@ -66,0 +100,0 @@ const records = [ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
825109
16180