-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: api插件配置拓展 新增过滤空字段 #112
base: develop
Are you sure you want to change the base?
Conversation
@@ -207,27 +207,40 @@ class UniformApiConfig(BaseSpaceConfig): | |||
value_type = SpaceConfigValueType.JSON.value | |||
default_value = {} | |||
example = {"meta_apis": "{meta_apis url}", "api_categories": "{api_categories url}"} | |||
# 拓展后也支持 example = {"key": {"meta_apis": "{meta_apis url}", "api_categories": "{api_categories url}"}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example 改成新协议,同时注释兼容老协议,新协议的 common 字段默认可以不暴露
@@ -137,10 +136,17 @@ def _dispatch_schedule_trigger(self, data, parent_data, callback_data=None): | |||
return False | |||
|
|||
space_configs = space_infos_result.get("data", {}).get("configs", {}) | |||
if space_configs.get("uniform_api", {}).get("common", {}).get("exclude_none_fields", False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里变复杂了,可以考虑定义 data model 来处理,这样处理有点难看,也可以后续优化
@@ -51,11 +51,19 @@ class UniformAPIMetaSerializer(serializers.Serializer): | |||
|
|||
|
|||
def _get_space_uniform_api_list_info(space_id, request_data, config_key): | |||
uniform_api_config = SpaceConfig.get_config(space_id=space_id, config_name=UniformApiConfig.name) | |||
if not uniform_api_config.get(config_key): | |||
uniform_api_configs = SpaceConfig.get_config(space_id=space_id, config_name=UniformApiConfig.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要加 s,还是一份配置
|
No description provided.