Skip to content

Commit

Permalink
Attribute.parseAttributes need to call super.parseAttributes in order…
Browse files Browse the repository at this point in the history
… for arrayType to be initialized. Fixes #238
  • Loading branch information
tpunder committed Apr 14, 2017
1 parent 3470f5b commit 0705e1c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/src/main/groovy/com/predic8/schema/Attribute.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Attribute extends Declaration {


protected parseAttributes(token, params){
super.parseAttributes(token, params)
name = token.getAttributeValue( null , 'name')
defaultValue = token.getAttributeValue( null , 'default')
fixedValue = token.getAttributeValue( null , 'fixed')
Expand Down
2 changes: 2 additions & 0 deletions core/src/test/groovy/com/predic8/schema/AttributeTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class AttributeTest extends GroovyTestCase{

void testParsing() {
assertEquals('id', schema.getType('CarType').getAttribute('id').name)
assertEquals('xsd:integer[]', schema.getType('CarType').getAttribute('id').arrayType)
assertEquals('xsd:integer[]', schema.getElement('MyCar').arrayType)
assertEquals('speed', schema.getType('CarType').getAttribute('speed').name)
assertEquals('door',schema.getType('SmallCarType').model.derivation.attributes[0].name)
// println schema.getType('SmallCarType').model.derivation.attributes[0].annotation.contents.content
Expand Down

0 comments on commit 0705e1c

Please sign in to comment.