fix: authn bad examples

This commit is contained in:
DDDHuang 2022-04-13 15:51:39 +08:00
parent 9ef1795985
commit bf827cffa8
2 changed files with 26 additions and 24 deletions

View File

@ -1412,6 +1412,9 @@ authenticator_examples() ->
status_metrics_example() ->
#{
status_metrics => #{
summary => <<"Authn status metrics">>,
value => #{
metrics => #{
matched => 0,
success => 0,
@ -1440,6 +1443,8 @@ status_metrics_example() ->
status => connected
}
]
}
}
}.
request_user_create_examples() ->

View File

@ -109,10 +109,7 @@ schema_with_example(Type, Example) ->
-spec(schema_with_examples(hocon_schema:type(), map()) -> hocon_schema:field_schema_map()).
schema_with_examples(Type, Examples) ->
%% Swagger can dynamically distinguish if there are multiple examples.
%% But explicitly declaring examples as plural
%% may cause some example structures to be incorrectly identified.
schema_with_example(Type, Examples).
hoconsc:mk(Type, #{examples => #{<<"examples">> => Examples}}).
-spec(error_codes(list(atom())) -> hocon_schema:fields()).
error_codes(Codes) ->