Просмотр исходного кода

chore: add doc_lift for authorization.sources

doc_lift is to make the doc render application to lift
this field to the root level and force the field's doc
to refernec it instead of expanding the structs in a nested way
Zaiming (Stone) Shi 2 лет назад
Родитель
Сommit
e978d86c86
2 измененных файлов с 4 добавлено и 2 удалено
  1. 1 1
      apps/emqx_authz/src/emqx_authz.app.src
  2. 3 1
      apps/emqx_authz/src/emqx_authz_schema.erl

+ 1 - 1
apps/emqx_authz/src/emqx_authz.app.src

@@ -1,7 +1,7 @@
 %% -*- mode: erlang -*-
 %% -*- mode: erlang -*-
 {application, emqx_authz, [
 {application, emqx_authz, [
     {description, "An OTP application"},
     {description, "An OTP application"},
-    {vsn, "0.1.15"},
+    {vsn, "0.1.16"},
     {registered, []},
     {registered, []},
     {mod, {emqx_authz_app, []}},
     {mod, {emqx_authz_app, []}},
     {applications, [
     {applications, [

+ 3 - 1
apps/emqx_authz/src/emqx_authz_schema.erl

@@ -492,7 +492,9 @@ authz_fields() ->
                 ?ARRAY(?UNION(UnionMemberSelector)),
                 ?ARRAY(?UNION(UnionMemberSelector)),
                 #{
                 #{
                     default => [],
                     default => [],
-                    desc => ?DESC(sources)
+                    desc => ?DESC(sources),
+                    %% doc_lift is force a root level reference instead of nesting sub-structs
+                    extra => #{doc_lift => true}
                 }
                 }
             )}
             )}
     ].
     ].