WSO2 G-Reg - Can an asset be created with name containing a '/'?

76 Views Asked by At

When creating an asset using the WSO2 Publisher REST API with a 'one/two' embedded in the name, the data is not being properly inserted into the REG_RESOURCE table. It seems to be interpreting the 'two' as the asset name and 'one' as the asset version. It maintains the name properly in the REG_CONTENT_DATA. Is there a way to get around this (i.e. escape the '/' somehow)? Or is it better to not allow a user to enter a '/' in the UI to begin with?

1

There are 1 best solutions below

0
On

If this asset field(attribute) is used when populating the registry path(storagePath), it is not allowed to use slash and few other special characters. So best option will be, avoid using this field in the storage path.

If you really want to use the above attribute in the storage path, what you can do is write a custom Registry Handler(Ex: custom registry handler) and replace that special character with some other value. However, I would recommend you to avoid using above attribute and use other unique attributes for the storage path.