Thanks, Enrico! Namespace, of course! I prefer usualy the simplicity of having one Database in one Namespace if possible.

Your great answer doesn't answer though my question. The situation is: I deploy a package, which contains:

persistent class(es), data(generated ok, but could be different), WebApp (aka CSP app). I deploy a Role also, which will be used by the WebApp. Role need the access to database... Here is my question, which database resource do I provide to the role as I don't know the namespace the package will be installed by a potential user? 

Great article! Thank you @Pablo Frigolett !

Also, if you develop in Docker there is an issue with server name, and my version of the same GetSpec method is:

ClassMethod GetSpec() As %DynamicObject

{

Set spec = {}.%FromJSON(##class(%Dictionary.CompiledXData).%OpenId("dc.Sample.v2rest.spec||OpenAPI").Data)

Set url = $Select(%request.Secure:"https",1:"http") _ "://"_$Get(%request.CgiEnvs("SERVER_NAME")) _ ":" _ $Get(%request.CgiEnvs("SERVER_PORT")) _ %request.Application

Set spec.servers = [{"url" : (url)}]

Quit spec

}

Thanks to @Lorenzo Scalese !