When a resource type inherits from another resource type, the "child" resource type does not correctly overwrite the inherited properties.
Current behavior:
#%RAML 0.8
---
title: Example API
baseUri: http://example.com
version: v1
resourceTypes:
- base:
description: a base resource type for other resource types to inherit from
get:
description: This description should be overwritten
queryParameters:
inheritedParam:
description: query parameter that should be inherited
- inheritFromBase:
description: this resource type inherits from `base`
type: base
get:
description: overwrites base description
queryParameters:
aNewParam:
description: another parameter added from base type
example: a new param
/inherit-resource-type:
type: inheritsBase
description: resource type inherits resource type
get:
displayName: get resource type
When parsed:
>>> api = parse(RAML_FILE)
>>> res = api.resources[0]
>>> r
ResourceNode(method='get', path='/inherit-resource-type')
>>> r.description.raw # this is expected
'overwrites base description'
>>> r.query_params # this is not - does not inherit query params
[QueryParameter(name='aNewParam')]
I would expect r.query_params to actually have two QueryParameter objects.
When a resource type inherits from another resource type, the "child" resource type does not correctly overwrite the inherited properties.
Current behavior:
When parsed:
I would expect
r.query_params
to actually have twoQueryParameter
objects.