I've designed my API resource as shown below (in accordance to e.g. this sample). It works and acts as supposed to.
yield return new ApiResource("my_resource")
{
Scopes = new string[]{ "my_scope" }
};
However, I just noticed that the above is wrong according to the docs, which baffles me. Apparently, it's supposed to be accepting an array of class Scope
, not string
.
yield return new ApiResource("my_wtf_resource")
{
Scopes = { new Scope("my_wtf_scope") }
};
That produces an error telling me that it can't convert from string
to Scope
. Well, du'h... It gets even weirder as I discovered that there is actually a class Scope
and it's located in the namespace Microsoft.OpenApi.Writers
, which is suspiciously close to security, identity and such.
What's up wth that? Am I confusing something or have the docs people made a boo-boo?