diff --git a/.env.template.yaml b/.env.template.yaml index 1ae4b420c6..488328e6fe 100644 --- a/.env.template.yaml +++ b/.env.template.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://hyperion.myecl.fr/settings-json-schema.json + ############################################### # Authorization using OAuth or Openid connect # ############################################### diff --git a/.env.test.yaml b/.env.test.yaml index ee5a770ffc..f77a4bc40d 100644 --- a/.env.test.yaml +++ b/.env.test.yaml @@ -1,3 +1,5 @@ +# yaml-language-server: $schema=https://hyperion.myecl.fr/settings-json-schema.json + ########################################################################### # This dotenv file and its values should NEVER be used in PRODUCTION! # ########################################################################### diff --git a/app/core/core_endpoints/endpoints_core.py b/app/core/core_endpoints/endpoints_core.py index abc008f24b..443b8e9df5 100644 --- a/app/core/core_endpoints/endpoints_core.py +++ b/app/core/core_endpoints/endpoints_core.py @@ -311,3 +311,20 @@ async def delete_module_account_type_visibility( allowed_account_type=account_type, db=db, ) + + +@router.get( + "/settings-json-schema.json", + status_code=200, +) +async def get_settings_json_schema(): + """ + Return Settings JSON schema. + + It can be used in vscode: + ```yml + # yaml-language-server: $schema=https://hyperion.myecl.fr/settings-json-schema.json + ``` + """ + + return Settings.model_json_schema()