From 063849836a735ec5ffa8dca112f6bfc6f089a861 Mon Sep 17 00:00:00 2001 From: tangcent Date: Wed, 18 Oct 2023 07:13:21 +0800 Subject: [PATCH] feat: Apply field rules to getter and setter methods (#1044) --- gradle.properties | 2 +- .../api/export/core/ClassExportRuleKeys.kt | 10 -- .../api/export/yapi/YapiPsiClassHelper.kt | 30 +++-- .../idea/plugin/rule/MyStringRuleMode.kt | 37 +++++- .../idea/utils/ContextualPsiClassHelper.kt | 73 +++++----- .../idea/utils/CustomizedPsiClassHelper.kt | 35 +++-- .../api/export/yapi/YapiFormatterTest.kt | 30 ++--- .../api/export/yapi/YapiPsiClassHelperTest.kt | 21 +-- .../plugin/rule/ScriptClassContextBaseTest.kt | 125 +++++++++++++----- .../utils/ContextualPsiClassHelperBaseTest.kt | 1 + .../utils/CustomizedPsiClassHelperTest.kt | 23 ++-- .../test/resources/annotation/JsonIgnore.java | 63 +++++++++ .../src/test/resources/model/Model.java | 34 +++++ 13 files changed, 330 insertions(+), 154 deletions(-) create mode 100644 idea-plugin/src/test/resources/annotation/JsonIgnore.java diff --git a/gradle.properties b/gradle.properties index 5258e5f15..3e09ca543 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,4 +3,4 @@ plugin_version=2.6.3.212.0 kotlin.code.style=official kotlin_version=1.8.0 junit_version=5.9.2 -itangcent_intellij_version=1.5.6 \ No newline at end of file +itangcent_intellij_version=1.5.7 \ No newline at end of file diff --git a/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/api/export/core/ClassExportRuleKeys.kt b/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/api/export/core/ClassExportRuleKeys.kt index 3036a59c1..96aa38030 100644 --- a/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/api/export/core/ClassExportRuleKeys.kt +++ b/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/api/export/core/ClassExportRuleKeys.kt @@ -230,16 +230,6 @@ object ClassExportRuleKeys { EventRuleMode.THROW_IN_ERROR ) - val JSON_METHOD_PARSE_BEFORE: RuleKey = SimpleRuleKey( - "json.method.parse.before", arrayOf("method.parse.before"), - EventRuleMode.THROW_IN_ERROR - ) - - val JSON_METHOD_PARSE_AFTER: RuleKey = SimpleRuleKey( - "json.method.parse.after", arrayOf("method.parse.after"), - EventRuleMode.THROW_IN_ERROR - ) - val JSON_ADDITIONAL_FIELD: RuleKey = SimpleRuleKey( "json.additional.field", StringRuleMode.MERGE_DISTINCT diff --git a/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/api/export/yapi/YapiPsiClassHelper.kt b/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/api/export/yapi/YapiPsiClassHelper.kt index 73314a38f..aa5373f58 100644 --- a/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/api/export/yapi/YapiPsiClassHelper.kt +++ b/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/api/export/yapi/YapiPsiClassHelper.kt @@ -7,14 +7,13 @@ import com.itangcent.common.utils.notNullOrEmpty import com.itangcent.common.utils.sub import com.itangcent.idea.plugin.api.export.AdditionalField import com.itangcent.idea.utils.CustomizedPsiClassHelper -import com.itangcent.intellij.config.rule.computer import com.itangcent.intellij.context.ActionContext import com.itangcent.intellij.extend.guice.PostConstruct -import com.itangcent.intellij.jvm.duck.DuckType +import com.itangcent.intellij.jvm.AccessibleField import com.itangcent.intellij.jvm.element.ExplicitClass -import com.itangcent.intellij.jvm.element.ExplicitElement import com.itangcent.intellij.psi.ContextSwitchListener import com.itangcent.intellij.psi.ResolveContext +import com.itangcent.intellij.psi.computer /** * support rules: @@ -38,35 +37,40 @@ class YapiPsiClassHelper : CustomizedPsiClassHelper() { } } - override fun afterParseFieldOrMethod( - fieldName: String, - fieldType: DuckType, - fieldOrMethod: ExplicitElement<*>, + override fun afterParseField( + accessibleField: AccessibleField, resourcePsiClass: ExplicitClass, resolveContext: ResolveContext, fields: MutableMap, ) { //compute `field.mock` - ruleComputer.computer(YapiClassExportRuleKeys.FIELD_MOCK, fieldOrMethod) + ruleComputer.computer(YapiClassExportRuleKeys.FIELD_MOCK, accessibleField) ?.takeIf { it.isNotBlank() } ?.let { if (resolveProperty) configReader.resolveProperty(it) else it } ?.let { mockInfo -> - fields.sub(Attrs.MOCK_ATTR)[fieldName] = mockInfo + fields.sub(Attrs.MOCK_ATTR)[accessibleField.jsonFieldName()] = mockInfo parseAsFieldValue(mockInfo) ?.also { KVUtils.useFieldAsAttr(it, Attrs.MOCK_ATTR) } - ?.let { populateFieldValue(fieldName, fieldType, fields, it) } + ?.let { + populateFieldValue( + accessibleField.jsonFieldName(), + accessibleField.jsonFieldType(), + fields, + it + ) + } } //compute `field.advanced` val advancedValue = ruleComputer.computer( YapiClassExportRuleKeys.FIELD_ADVANCED, - fieldOrMethod + accessibleField ) if (advancedValue.notNullOrEmpty()) { - fields.sub(Attrs.ADVANCED_ATTR)[fieldName] = advancedValue + fields.sub(Attrs.ADVANCED_ATTR)[accessibleField.jsonFieldName()] = advancedValue } - super.afterParseFieldOrMethod(fieldName, fieldType, fieldOrMethod, resourcePsiClass, resolveContext, fields) + super.afterParseField(accessibleField, resourcePsiClass, resolveContext, fields) } override fun resolveAdditionalField( diff --git a/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/rule/MyStringRuleMode.kt b/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/rule/MyStringRuleMode.kt index 112afa0ec..573ba27a3 100644 --- a/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/rule/MyStringRuleMode.kt +++ b/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/rule/MyStringRuleMode.kt @@ -1,18 +1,19 @@ package com.itangcent.idea.plugin.rule -import com.itangcent.common.utils.notNullOrEmpty import com.itangcent.intellij.config.rule.RuleChain import com.itangcent.intellij.config.rule.RuleMode -import com.itangcent.intellij.config.rule.asSequence import kotlin.reflect.KClass enum class MyStringRuleMode : RuleMode { LIST { - override fun compute(rules: RuleChain): Any? { - return rules - .asSequence() - .map { it.compute() } - .filter { it.notNullOrEmpty() } + override fun compute(rules: RuleChain): Any { + return (rules as RuleChain) + .mapNotNull { it() } + .flatMap { + it.flatten() + } + .mapNotNull { it as? String } + .filter { it.isNotEmpty() } .toList() } }; @@ -20,4 +21,26 @@ enum class MyStringRuleMode : RuleMode { override fun targetType(): KClass { return String::class } + + companion object { + private fun Any?.flatten(): List { + return when (this) { + null -> { + emptyList() + } + + is Array<*> -> { + this.toList().flatten() + } + + is Collection<*> -> { + this.flatMap { it.flatten() } + } + + else -> { + listOf(this) + } + } + } + } } \ No newline at end of file diff --git a/idea-plugin/src/main/kotlin/com/itangcent/idea/utils/ContextualPsiClassHelper.kt b/idea-plugin/src/main/kotlin/com/itangcent/idea/utils/ContextualPsiClassHelper.kt index d07e20651..38bc27f64 100644 --- a/idea-plugin/src/main/kotlin/com/itangcent/idea/utils/ContextualPsiClassHelper.kt +++ b/idea-plugin/src/main/kotlin/com/itangcent/idea/utils/ContextualPsiClassHelper.kt @@ -14,18 +14,16 @@ import com.itangcent.intellij.config.ConfigReader import com.itangcent.intellij.config.rule.RuleComputeListener import com.itangcent.intellij.config.rule.RuleContext import com.itangcent.intellij.config.rule.RuleKey -import com.itangcent.intellij.config.rule.computer import com.itangcent.intellij.extend.guice.PostConstruct +import com.itangcent.intellij.jvm.AccessibleField import com.itangcent.intellij.jvm.JsonOption import com.itangcent.intellij.jvm.JsonOption.has -import com.itangcent.intellij.jvm.duck.DuckType import com.itangcent.intellij.jvm.duck.SingleDuckType import com.itangcent.intellij.jvm.element.ExplicitClass -import com.itangcent.intellij.jvm.element.ExplicitElement -import com.itangcent.intellij.jvm.element.ExplicitMethod import com.itangcent.intellij.psi.ClassRuleKeys import com.itangcent.intellij.psi.DefaultPsiClassHelper import com.itangcent.intellij.psi.ResolveContext +import com.itangcent.intellij.psi.computer import java.util.* /** @@ -54,7 +52,11 @@ open class ContextualPsiClassHelper : DefaultPsiClassHelper() { (ruleComputeListener as? RuleComputeListenerRegistry)?.register(InnerComputeListener()) } - override fun beforeParseClass(psiClass: PsiClass, resolveContext: ResolveContext, fields: MutableMap) { + override fun beforeParseClass( + psiClass: PsiClass, + resolveContext: ResolveContext, + fields: MutableMap + ) { tryInitParseContext() ruleComputer.computer(ClassExportRuleKeys.JSON_CLASS_PARSE_BEFORE, psiClass) super.beforeParseClass(psiClass, resolveContext, fields) @@ -120,22 +122,21 @@ open class ContextualPsiClassHelper : DefaultPsiClassHelper() { } } - override fun beforeParseFieldOrMethod( - fieldName: String, - fieldType: DuckType, - fieldOrMethod: ExplicitElement<*>, + override fun beforeParseField( + accessField: AccessibleField, resourcePsiClass: ExplicitClass, resolveContext: ResolveContext, fields: MutableMap, ): Boolean { - pushField(fieldName) - if (fieldOrMethod is ExplicitMethod) { - ruleComputer.computer(ClassExportRuleKeys.JSON_METHOD_PARSE_BEFORE, fieldOrMethod) - } else { - ruleComputer.computer(ClassExportRuleKeys.JSON_FIELD_PARSE_BEFORE, fieldOrMethod) - } + pushField(accessField.jsonFieldName()) + ruleComputer.computer(ClassExportRuleKeys.JSON_FIELD_PARSE_BEFORE, accessField) - return super.beforeParseFieldOrMethod(fieldName, fieldType, fieldOrMethod, resourcePsiClass, resolveContext, fields) + return super.beforeParseField( + accessField, + resourcePsiClass, + resolveContext, + fields + ) } private fun pushField(fieldName: String) { @@ -145,35 +146,37 @@ open class ContextualPsiClassHelper : DefaultPsiClassHelper() { } } - override fun onIgnoredParseFieldOrMethod( - fieldName: String, - fieldType: DuckType, - fieldOrMethod: ExplicitElement<*>, + override fun onIgnoredParseField( + accessibleField: AccessibleField, resourcePsiClass: ExplicitClass, resolveContext: ResolveContext, - fields: MutableMap, + fields: MutableMap ) { - super.onIgnoredParseFieldOrMethod(fieldName, fieldType, fieldOrMethod, resourcePsiClass, resolveContext, fields) - popField(fieldName) + super.onIgnoredParseField( + accessibleField, + resourcePsiClass, + resolveContext, + fields + ) + popField(accessibleField.jsonFieldName()) } - override fun afterParseFieldOrMethod( - fieldName: String, - fieldType: DuckType, - fieldOrMethod: ExplicitElement<*>, + override fun afterParseField( + accessibleField: AccessibleField, resourcePsiClass: ExplicitClass, resolveContext: ResolveContext, fields: MutableMap, ) { - super.afterParseFieldOrMethod(fieldName, fieldType, fieldOrMethod, resourcePsiClass, resolveContext, fields) + super.afterParseField( + accessibleField, + resourcePsiClass, + resolveContext, + fields + ) - if (fieldOrMethod is ExplicitMethod) { - ruleComputer.computer(ClassExportRuleKeys.JSON_METHOD_PARSE_AFTER, fieldOrMethod) - } else { - ruleComputer.computer(ClassExportRuleKeys.JSON_FIELD_PARSE_AFTER, fieldOrMethod) - } - popField(fieldName) - computeAdditionalField(fieldOrMethod.psi(), resolveContext, fields) + ruleComputer.computer(ClassExportRuleKeys.JSON_FIELD_PARSE_AFTER, accessibleField) + popField(accessibleField.jsonFieldName()) + computeAdditionalField(accessibleField.psi, resolveContext, fields) } protected open fun computeAdditionalField( diff --git a/idea-plugin/src/main/kotlin/com/itangcent/idea/utils/CustomizedPsiClassHelper.kt b/idea-plugin/src/main/kotlin/com/itangcent/idea/utils/CustomizedPsiClassHelper.kt index 9cd080b84..73ee14844 100644 --- a/idea-plugin/src/main/kotlin/com/itangcent/idea/utils/CustomizedPsiClassHelper.kt +++ b/idea-plugin/src/main/kotlin/com/itangcent/idea/utils/CustomizedPsiClassHelper.kt @@ -11,15 +11,14 @@ import com.itangcent.common.utils.* import com.itangcent.idea.plugin.api.export.AdditionalField import com.itangcent.idea.plugin.api.export.core.ClassExportRuleKeys import com.itangcent.idea.plugin.settings.EventRecords -import com.itangcent.intellij.config.rule.computer import com.itangcent.intellij.extend.toPrettyString +import com.itangcent.intellij.jvm.AccessibleField import com.itangcent.intellij.jvm.PsiExpressionResolver import com.itangcent.intellij.jvm.duck.DuckType import com.itangcent.intellij.jvm.element.ExplicitClass -import com.itangcent.intellij.jvm.element.ExplicitElement -import com.itangcent.intellij.jvm.element.ExplicitField import com.itangcent.intellij.psi.ObjectHolder import com.itangcent.intellij.psi.ResolveContext +import com.itangcent.intellij.psi.computer import com.itangcent.intellij.psi.getOrResolve import com.itangcent.utils.isCollections @@ -33,46 +32,44 @@ open class CustomizedPsiClassHelper : ContextualPsiClassHelper() { @Inject private lateinit var psiExpressionResolver: PsiExpressionResolver - override fun afterParseFieldOrMethod( - fieldName: String, - fieldType: DuckType, - fieldOrMethod: ExplicitElement<*>, + override fun afterParseField( + accessibleField: AccessibleField, resourcePsiClass: ExplicitClass, resolveContext: ResolveContext, fields: MutableMap, ) { //compute `field.required` - ruleComputer.computer(ClassExportRuleKeys.FIELD_REQUIRED, fieldOrMethod)?.let { required -> - fields.sub(Attrs.REQUIRED_ATTR)[fieldName] = required + ruleComputer.computer(ClassExportRuleKeys.FIELD_REQUIRED, accessibleField)?.let { required -> + fields.sub(Attrs.REQUIRED_ATTR)[accessibleField.jsonFieldName()] = required } //compute `field.default.value` - val defaultValue = ruleComputer.computer(ClassExportRuleKeys.FIELD_DEFAULT_VALUE, fieldOrMethod) + val defaultValue = ruleComputer.computer(ClassExportRuleKeys.FIELD_DEFAULT_VALUE, accessibleField) if (defaultValue.isNullOrEmpty()) { - if (fieldOrMethod is ExplicitField) { - fieldOrMethod.psi().initializer?.let { psiExpressionResolver.process(it) }?.toPrettyString() - ?.let { fields.sub(Attrs.DEFAULT_VALUE_ATTR)[fieldName] = it } + accessibleField.field?.psi()?.let { field -> + field.initializer?.let { psiExpressionResolver.process(it) }?.toPrettyString() + ?.let { fields.sub(Attrs.DEFAULT_VALUE_ATTR)[accessibleField.jsonFieldName()] = it } } } else { - fields.sub(Attrs.DEFAULT_VALUE_ATTR)[fieldName] = defaultValue + fields.sub(Attrs.DEFAULT_VALUE_ATTR)[accessibleField.jsonFieldName()] = defaultValue parseAsFieldValue(defaultValue) ?.also { KVUtils.useFieldAsAttr(it, Attrs.DEFAULT_VALUE_ATTR) } - ?.let { populateFieldValue(fieldName, fieldType, fields, it) } + ?.let { populateFieldValue(accessibleField.jsonFieldName(), accessibleField.jsonFieldType(), fields, it) } } //compute `field.demo` val demoValue = ruleComputer.computer( ClassExportRuleKeys.FIELD_DEMO, - fieldOrMethod + accessibleField ) if (demoValue.notNullOrBlank()) { - fields.sub(Attrs.DEMO_ATTR)[fieldName] = demoValue + fields.sub(Attrs.DEMO_ATTR)[accessibleField.jsonFieldName()] = demoValue demoValue?.let { parseAsFieldValue(it) } ?.also { KVUtils.useFieldAsAttr(it, Attrs.DEMO_ATTR) } - ?.let { populateFieldValue(fieldName, fieldType, fields, it) } + ?.let { populateFieldValue(accessibleField.jsonFieldName(), accessibleField.jsonFieldType(), fields, it) } } - super.afterParseFieldOrMethod(fieldName, fieldType, fieldOrMethod, resourcePsiClass, resolveContext, fields) + super.afterParseField(accessibleField, resourcePsiClass, resolveContext, fields) } override fun resolveAdditionalField( diff --git a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/api/export/yapi/YapiFormatterTest.kt b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/api/export/yapi/YapiFormatterTest.kt index 5b0e9abbe..8d46dfd34 100644 --- a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/api/export/yapi/YapiFormatterTest.kt +++ b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/api/export/yapi/YapiFormatterTest.kt @@ -96,15 +96,15 @@ internal abstract class YapiFormatterTest : YapiSpringClassExporterBaseTest() { yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 1]).toJson() ) assertEquals( - "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/query\",\"params\":[]},\"method\":\"GET\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with query\",\"path\":\"/default/query\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[{\"name\":\"intArr[0]\",\"value\":123,\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"intArr[1]\",\"value\":456,\"example\":\"456\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.abc\",\"value\":\"123\",\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.def\",\"value\":\"456\",\"example\":\"456\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[0]\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[1]\",\"value\":\"123\",\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"invalid[0]\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"model.str\",\"value\":\"\",\"desc\":\"string field\",\"required\":0},{\"name\":\"model.integer\",\"value\":0,\"desc\":\"integer field\",\"required\":0},{\"name\":\"model.stringList\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"stringList field\",\"required\":0},{\"name\":\"model.integerArray[0]\",\"value\":0,\"desc\":\"integerArray field\",\"required\":0},{\"name\":\"model.s\",\"value\":\"aaa\",\"example\":\"aaa\",\"desc\":\"\",\"required\":0},{\"name\":\"model.s2\",\"value\":\"bbb\",\"example\":\"bbb\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[0].str\",\"value\":\"\",\"desc\":\"string field\",\"required\":0},{\"name\":\"modelList[0].integer\",\"value\":0,\"desc\":\"integer field\",\"required\":0},{\"name\":\"modelList[0].stringList[0]\",\"value\":\"\",\"desc\":\"stringList field\",\"required\":0},{\"name\":\"modelList[0].integerArray[0]\",\"value\":0,\"desc\":\"integerArray field\",\"required\":0}],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", + "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/query\",\"params\":[]},\"method\":\"GET\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with query\",\"path\":\"/default/query\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[{\"name\":\"intArr[0]\",\"value\":123,\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"intArr[1]\",\"value\":456,\"example\":\"456\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.abc\",\"value\":\"123\",\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.def\",\"value\":\"456\",\"example\":\"456\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[0]\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[1]\",\"value\":\"123\",\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"invalid[0]\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"model.str\",\"value\":\"\",\"desc\":\"string field\",\"required\":0},{\"name\":\"model.integer\",\"value\":0,\"desc\":\"integer field\",\"required\":0},{\"name\":\"model.stringList\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"stringList field\",\"required\":0},{\"name\":\"model.integerArray[0]\",\"value\":0,\"desc\":\"integerArray field\",\"required\":0},{\"name\":\"model.shouldIgnore\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"model.shouldIgnoreByGetter\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"model.shouldIgnoreBySetter\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"model.s\",\"value\":\"aaa\",\"example\":\"aaa\",\"desc\":\"\",\"required\":0},{\"name\":\"model.s2\",\"value\":\"bbb\",\"example\":\"bbb\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[0].str\",\"value\":\"\",\"desc\":\"string field\",\"required\":0},{\"name\":\"modelList[0].integer\",\"value\":0,\"desc\":\"integer field\",\"required\":0},{\"name\":\"modelList[0].stringList[0]\",\"value\":\"\",\"desc\":\"stringList field\",\"required\":0},{\"name\":\"modelList[0].integerArray[0]\",\"value\":0,\"desc\":\"integerArray field\",\"required\":0},{\"name\":\"modelList[0].shouldIgnore\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[0].shouldIgnoreByGetter\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[0].shouldIgnoreBySetter\",\"value\":\"\",\"desc\":\"\",\"required\":0}],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 2]).toJson() ) assertEquals( - "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/form\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"form\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with form\",\"req_body_form\":[{\"name\":\"intArr[0]\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"intArr[1]\",\"example\":\"456\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.abc\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.def\",\"example\":\"456\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[0]\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[1]\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"invalid[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.str\",\"type\":\"text\",\"required\":0,\"desc\":\"string field\"},{\"name\":\"model.integer\",\"type\":\"text\",\"required\":0,\"desc\":\"integer field\"},{\"name\":\"model.stringList\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"stringList field\"},{\"name\":\"model.integerArray[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"integerArray field\"},{\"name\":\"model.s\",\"example\":\"aaa\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.s2\",\"example\":\"bbb\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[0].str\",\"type\":\"text\",\"required\":0,\"desc\":\"string field\"},{\"name\":\"modelList[0].integer\",\"type\":\"text\",\"required\":0,\"desc\":\"integer field\"},{\"name\":\"modelList[0].stringList[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"stringList field\"},{\"name\":\"modelList[0].integerArray[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"integerArray field\"}],\"path\":\"/default/form\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"multipart/form-data\",\"example\":\"multipart/form-data\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", + "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/form\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"form\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with form\",\"req_body_form\":[{\"name\":\"intArr[0]\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"intArr[1]\",\"example\":\"456\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.abc\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.def\",\"example\":\"456\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[0]\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[1]\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"invalid[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.str\",\"type\":\"text\",\"required\":0,\"desc\":\"string field\"},{\"name\":\"model.integer\",\"type\":\"text\",\"required\":0,\"desc\":\"integer field\"},{\"name\":\"model.stringList\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"stringList field\"},{\"name\":\"model.integerArray[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"integerArray field\"},{\"name\":\"model.shouldIgnore\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.shouldIgnoreByGetter\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.shouldIgnoreBySetter\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.s\",\"example\":\"aaa\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.s2\",\"example\":\"bbb\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[0].str\",\"type\":\"text\",\"required\":0,\"desc\":\"string field\"},{\"name\":\"modelList[0].integer\",\"type\":\"text\",\"required\":0,\"desc\":\"integer field\"},{\"name\":\"modelList[0].stringList[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"stringList field\"},{\"name\":\"modelList[0].integerArray[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"integerArray field\"},{\"name\":\"modelList[0].shouldIgnore\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[0].shouldIgnoreByGetter\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[0].shouldIgnoreBySetter\",\"type\":\"text\",\"required\":0,\"desc\":\"\"}],\"path\":\"/default/form\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"multipart/form-data\",\"example\":\"multipart/form-data\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 3]).toJson() ) assertEquals( - "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/body\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"json\",\"res_body_type\":\"json\",\"index\":0,\"req_body_other\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"type\":\"static\",\"title\":\"call with body\",\"req_body_form\":[],\"path\":\"/default/body\",\"req_body_is_json_schema\":true,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"application/json\",\"example\":\"application/json\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", + "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/body\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"json\",\"res_body_type\":\"json\",\"index\":0,\"req_body_other\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"type\":\"static\",\"title\":\"call with body\",\"req_body_form\":[],\"path\":\"/default/body\",\"req_body_is_json_schema\":true,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"application/json\",\"example\":\"application/json\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 4]).toJson() ) } @@ -147,15 +147,15 @@ internal abstract class YapiFormatterTest : YapiSpringClassExporterBaseTest() { yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 1]).toJson() ) assertEquals( - "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/query\",\"params\":[]},\"method\":\"GET\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with query\",\"path\":\"/default/query\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[{\"name\":\"intArr\",\"value\":\"[123, 456]\",\"example\":\"[123, 456]\",\"desc\":\"\",\"required\":0},{\"name\":\"amount\",\"value\":\"{\\\"abc\\\":\\\"123\\\",\\\"def\\\":\\\"456\\\"}\",\"example\":\"{\\\"abc\\\":\\\"123\\\",\\\"def\\\":\\\"456\\\"}\",\"desc\":\"\",\"required\":0},{\"name\":\"strings\",\"value\":\"[\\\"abc\\\",\\\"123\\\"]\",\"example\":\"[\\\"abc\\\",\\\"123\\\"]\",\"desc\":\"\",\"required\":0},{\"name\":\"invalid\",\"value\":\"[\\\"abc\\\",\\\"123\\\"}\",\"example\":\"[\\\"abc\\\",\\\"123\\\"}\",\"desc\":\"\",\"required\":0},{\"name\":\"model\",\"value\":\"{\\\"s\\\":\\\"aaa\\\",\\\"s2\\\":\\\"bbb\\\",\\\"stringList\\\":\\\"abc\\\"}\",\"example\":\"{\\\"s\\\":\\\"aaa\\\",\\\"s2\\\":\\\"bbb\\\",\\\"stringList\\\":\\\"abc\\\"}\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList\",\"value\":\"[{\\\"s\\\":\\\"aaa\\\",\\\"s2\\\":\\\"bbb\\\",\\\"stringList\\\":\\\"abc\\\"}}\",\"example\":\"[{\\\"s\\\":\\\"aaa\\\",\\\"s2\\\":\\\"bbb\\\",\\\"stringList\\\":\\\"abc\\\"}}\",\"desc\":\"\",\"required\":0}],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", + "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/query\",\"params\":[]},\"method\":\"GET\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with query\",\"path\":\"/default/query\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[{\"name\":\"intArr\",\"value\":\"[123, 456]\",\"example\":\"[123, 456]\",\"desc\":\"\",\"required\":0},{\"name\":\"amount\",\"value\":\"{\\\"abc\\\":\\\"123\\\",\\\"def\\\":\\\"456\\\"}\",\"example\":\"{\\\"abc\\\":\\\"123\\\",\\\"def\\\":\\\"456\\\"}\",\"desc\":\"\",\"required\":0},{\"name\":\"strings\",\"value\":\"[\\\"abc\\\",\\\"123\\\"]\",\"example\":\"[\\\"abc\\\",\\\"123\\\"]\",\"desc\":\"\",\"required\":0},{\"name\":\"invalid\",\"value\":\"[\\\"abc\\\",\\\"123\\\"}\",\"example\":\"[\\\"abc\\\",\\\"123\\\"}\",\"desc\":\"\",\"required\":0},{\"name\":\"model\",\"value\":\"{\\\"s\\\":\\\"aaa\\\",\\\"s2\\\":\\\"bbb\\\",\\\"stringList\\\":\\\"abc\\\"}\",\"example\":\"{\\\"s\\\":\\\"aaa\\\",\\\"s2\\\":\\\"bbb\\\",\\\"stringList\\\":\\\"abc\\\"}\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList\",\"value\":\"[{\\\"s\\\":\\\"aaa\\\",\\\"s2\\\":\\\"bbb\\\",\\\"stringList\\\":\\\"abc\\\"}}\",\"example\":\"[{\\\"s\\\":\\\"aaa\\\",\\\"s2\\\":\\\"bbb\\\",\\\"stringList\\\":\\\"abc\\\"}}\",\"desc\":\"\",\"required\":0}],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 2]).toJson() ) assertEquals( - "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/form\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"form\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with form\",\"req_body_form\":[{\"name\":\"intArr\",\"example\":\"[123, 456]\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount\",\"example\":\"{\\\"abc\\\":\\\"123\\\",\\\"def\\\":\\\"456\\\"}\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings\",\"example\":\"[\\\"abc\\\",\\\"123\\\"]\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"invalid\",\"example\":\"[\\\"abc\\\",\\\"123\\\"}\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model\",\"example\":\"{\\\"s\\\":\\\"aaa\\\",\\\"s2\\\":\\\"bbb\\\",\\\"stringList\\\":\\\"abc\\\"}\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList\",\"example\":\"[{\\\"s\\\":\\\"aaa\\\",\\\"s2\\\":\\\"bbb\\\",\\\"stringList\\\":\\\"abc\\\"}}\",\"type\":\"text\",\"required\":0,\"desc\":\"\"}],\"path\":\"/default/form\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"multipart/form-data\",\"example\":\"multipart/form-data\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", + "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/form\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"form\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with form\",\"req_body_form\":[{\"name\":\"intArr\",\"example\":\"[123, 456]\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount\",\"example\":\"{\\\"abc\\\":\\\"123\\\",\\\"def\\\":\\\"456\\\"}\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings\",\"example\":\"[\\\"abc\\\",\\\"123\\\"]\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"invalid\",\"example\":\"[\\\"abc\\\",\\\"123\\\"}\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model\",\"example\":\"{\\\"s\\\":\\\"aaa\\\",\\\"s2\\\":\\\"bbb\\\",\\\"stringList\\\":\\\"abc\\\"}\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList\",\"example\":\"[{\\\"s\\\":\\\"aaa\\\",\\\"s2\\\":\\\"bbb\\\",\\\"stringList\\\":\\\"abc\\\"}}\",\"type\":\"text\",\"required\":0,\"desc\":\"\"}],\"path\":\"/default/form\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"multipart/form-data\",\"example\":\"multipart/form-data\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 3]).toJson() ) assertEquals( - "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/body\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"json\",\"res_body_type\":\"json\",\"index\":0,\"req_body_other\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"type\":\"static\",\"title\":\"call with body\",\"req_body_form\":[],\"path\":\"/default/body\",\"req_body_is_json_schema\":true,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"application/json\",\"example\":\"application/json\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", + "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/body\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"json\",\"res_body_type\":\"json\",\"index\":0,\"req_body_other\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"type\":\"static\",\"title\":\"call with body\",\"req_body_form\":[],\"path\":\"/default/body\",\"req_body_is_json_schema\":true,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"application/json\",\"example\":\"application/json\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 4]).toJson() ) } @@ -200,15 +200,15 @@ internal abstract class YapiFormatterTest : YapiSpringClassExporterBaseTest() { yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 1]).toJson()!!.toUnixString() ) assertEquals( - "[{\"res_body\":\"{\\n \\\"code\\\": \\\"200\\\", //response code\\n \\\"msg\\\": \\\"ok\\\", //message\\n \\\"data\\\": { //response data\\n \\\"intArr\\\": [\\n \\\"666\\\",\\n \\\"666\\\"\\n ],\\n \\\"amount\\\": {\\n \\\"abc\\\": \\\"str\\\",\\n \\\"def\\\": \\\"str\\\"\\n },\\n \\\"strings\\\": [\\n \\\"str\\\",\\n \\\"str\\\"\\n ],\\n \\\"invalid\\\": [\\n \\\"str\\\"\\n ],\\n \\\"model\\\": {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": \\\"str\\\", //stringList field\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": [ //stringList field\\n \\\"str\\\"\\n ],\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ]\\n }\\n ]\\n }\\n}\",\"query_path\":{\"path\":\"/default/query\",\"params\":[]},\"method\":\"GET\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with query\",\"path\":\"/default/query\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[{\"name\":\"intArr[0]\",\"value\":123,\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"intArr[1]\",\"value\":456,\"example\":\"456\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.abc\",\"value\":\"123\",\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.def\",\"value\":\"456\",\"example\":\"456\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[0]\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[1]\",\"value\":\"123\",\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"invalid[0]\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"model.str\",\"value\":\"\",\"desc\":\"string field\",\"required\":0},{\"name\":\"model.integer\",\"value\":0,\"desc\":\"integer field\",\"required\":0},{\"name\":\"model.stringList\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"stringList field\",\"required\":0},{\"name\":\"model.integerArray[0]\",\"value\":0,\"desc\":\"integerArray field\",\"required\":0},{\"name\":\"model.s\",\"value\":\"aaa\",\"example\":\"aaa\",\"desc\":\"\",\"required\":0},{\"name\":\"model.s2\",\"value\":\"bbb\",\"example\":\"bbb\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[0].str\",\"value\":\"\",\"desc\":\"string field\",\"required\":0},{\"name\":\"modelList[0].integer\",\"value\":0,\"desc\":\"integer field\",\"required\":0},{\"name\":\"modelList[0].stringList[0]\",\"value\":\"\",\"desc\":\"stringList field\",\"required\":0},{\"name\":\"modelList[0].integerArray[0]\",\"value\":0,\"desc\":\"integerArray field\",\"required\":0}],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":false,\"status\":\"done\",\"desc\":\"

\"}]", + "[{\"res_body\":\"{\\n \\\"code\\\": \\\"200\\\", //response code\\n \\\"msg\\\": \\\"ok\\\", //message\\n \\\"data\\\": { //response data\\n \\\"intArr\\\": [\\n \\\"666\\\",\\n \\\"666\\\"\\n ],\\n \\\"amount\\\": {\\n \\\"abc\\\": \\\"str\\\",\\n \\\"def\\\": \\\"str\\\"\\n },\\n \\\"strings\\\": [\\n \\\"str\\\",\\n \\\"str\\\"\\n ],\\n \\\"invalid\\\": [\\n \\\"str\\\"\\n ],\\n \\\"model\\\": {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": \\\"str\\\", //stringList field\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"shouldIgnore\\\": \\\"str\\\",\\n \\\"shouldIgnoreByGetter\\\": \\\"str\\\",\\n \\\"shouldIgnoreBySetter\\\": \\\"str\\\",\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": [ //stringList field\\n \\\"str\\\"\\n ],\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"shouldIgnore\\\": \\\"str\\\",\\n \\\"shouldIgnoreByGetter\\\": \\\"str\\\",\\n \\\"shouldIgnoreBySetter\\\": \\\"str\\\"\\n }\\n ]\\n }\\n}\",\"query_path\":{\"path\":\"/default/query\",\"params\":[]},\"method\":\"GET\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with query\",\"path\":\"/default/query\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[{\"name\":\"intArr[0]\",\"value\":123,\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"intArr[1]\",\"value\":456,\"example\":\"456\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.abc\",\"value\":\"123\",\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.def\",\"value\":\"456\",\"example\":\"456\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[0]\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[1]\",\"value\":\"123\",\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"invalid[0]\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"model.str\",\"value\":\"\",\"desc\":\"string field\",\"required\":0},{\"name\":\"model.integer\",\"value\":0,\"desc\":\"integer field\",\"required\":0},{\"name\":\"model.stringList\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"stringList field\",\"required\":0},{\"name\":\"model.integerArray[0]\",\"value\":0,\"desc\":\"integerArray field\",\"required\":0},{\"name\":\"model.shouldIgnore\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"model.shouldIgnoreByGetter\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"model.shouldIgnoreBySetter\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"model.s\",\"value\":\"aaa\",\"example\":\"aaa\",\"desc\":\"\",\"required\":0},{\"name\":\"model.s2\",\"value\":\"bbb\",\"example\":\"bbb\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[0].str\",\"value\":\"\",\"desc\":\"string field\",\"required\":0},{\"name\":\"modelList[0].integer\",\"value\":0,\"desc\":\"integer field\",\"required\":0},{\"name\":\"modelList[0].stringList[0]\",\"value\":\"\",\"desc\":\"stringList field\",\"required\":0},{\"name\":\"modelList[0].integerArray[0]\",\"value\":0,\"desc\":\"integerArray field\",\"required\":0},{\"name\":\"modelList[0].shouldIgnore\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[0].shouldIgnoreByGetter\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[0].shouldIgnoreBySetter\",\"value\":\"\",\"desc\":\"\",\"required\":0}],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":false,\"status\":\"done\",\"desc\":\"

\"}]", yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 2]).toJson()!!.toUnixString() ) assertEquals( - "[{\"res_body\":\"{\\n \\\"code\\\": \\\"200\\\", //response code\\n \\\"msg\\\": \\\"ok\\\", //message\\n \\\"data\\\": { //response data\\n \\\"intArr\\\": [\\n \\\"666\\\",\\n \\\"666\\\"\\n ],\\n \\\"amount\\\": {\\n \\\"abc\\\": \\\"str\\\",\\n \\\"def\\\": \\\"str\\\"\\n },\\n \\\"strings\\\": [\\n \\\"str\\\",\\n \\\"str\\\"\\n ],\\n \\\"invalid\\\": [\\n \\\"str\\\"\\n ],\\n \\\"model\\\": {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": \\\"str\\\", //stringList field\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": [ //stringList field\\n \\\"str\\\"\\n ],\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ]\\n }\\n ]\\n }\\n}\",\"query_path\":{\"path\":\"/default/form\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"form\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with form\",\"req_body_form\":[{\"name\":\"intArr[0]\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"intArr[1]\",\"example\":\"456\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.abc\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.def\",\"example\":\"456\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[0]\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[1]\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"invalid[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.str\",\"type\":\"text\",\"required\":0,\"desc\":\"string field\"},{\"name\":\"model.integer\",\"type\":\"text\",\"required\":0,\"desc\":\"integer field\"},{\"name\":\"model.stringList\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"stringList field\"},{\"name\":\"model.integerArray[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"integerArray field\"},{\"name\":\"model.s\",\"example\":\"aaa\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.s2\",\"example\":\"bbb\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[0].str\",\"type\":\"text\",\"required\":0,\"desc\":\"string field\"},{\"name\":\"modelList[0].integer\",\"type\":\"text\",\"required\":0,\"desc\":\"integer field\"},{\"name\":\"modelList[0].stringList[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"stringList field\"},{\"name\":\"modelList[0].integerArray[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"integerArray field\"}],\"path\":\"/default/form\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"multipart/form-data\",\"example\":\"multipart/form-data\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":false,\"status\":\"done\",\"desc\":\"

\"}]", + "[{\"res_body\":\"{\\n \\\"code\\\": \\\"200\\\", //response code\\n \\\"msg\\\": \\\"ok\\\", //message\\n \\\"data\\\": { //response data\\n \\\"intArr\\\": [\\n \\\"666\\\",\\n \\\"666\\\"\\n ],\\n \\\"amount\\\": {\\n \\\"abc\\\": \\\"str\\\",\\n \\\"def\\\": \\\"str\\\"\\n },\\n \\\"strings\\\": [\\n \\\"str\\\",\\n \\\"str\\\"\\n ],\\n \\\"invalid\\\": [\\n \\\"str\\\"\\n ],\\n \\\"model\\\": {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": \\\"str\\\", //stringList field\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"shouldIgnore\\\": \\\"str\\\",\\n \\\"shouldIgnoreByGetter\\\": \\\"str\\\",\\n \\\"shouldIgnoreBySetter\\\": \\\"str\\\",\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": [ //stringList field\\n \\\"str\\\"\\n ],\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"shouldIgnore\\\": \\\"str\\\",\\n \\\"shouldIgnoreByGetter\\\": \\\"str\\\",\\n \\\"shouldIgnoreBySetter\\\": \\\"str\\\"\\n }\\n ]\\n }\\n}\",\"query_path\":{\"path\":\"/default/form\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"form\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with form\",\"req_body_form\":[{\"name\":\"intArr[0]\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"intArr[1]\",\"example\":\"456\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.abc\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.def\",\"example\":\"456\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[0]\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[1]\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"invalid[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.str\",\"type\":\"text\",\"required\":0,\"desc\":\"string field\"},{\"name\":\"model.integer\",\"type\":\"text\",\"required\":0,\"desc\":\"integer field\"},{\"name\":\"model.stringList\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"stringList field\"},{\"name\":\"model.integerArray[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"integerArray field\"},{\"name\":\"model.shouldIgnore\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.shouldIgnoreByGetter\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.shouldIgnoreBySetter\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.s\",\"example\":\"aaa\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.s2\",\"example\":\"bbb\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[0].str\",\"type\":\"text\",\"required\":0,\"desc\":\"string field\"},{\"name\":\"modelList[0].integer\",\"type\":\"text\",\"required\":0,\"desc\":\"integer field\"},{\"name\":\"modelList[0].stringList[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"stringList field\"},{\"name\":\"modelList[0].integerArray[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"integerArray field\"},{\"name\":\"modelList[0].shouldIgnore\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[0].shouldIgnoreByGetter\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[0].shouldIgnoreBySetter\",\"type\":\"text\",\"required\":0,\"desc\":\"\"}],\"path\":\"/default/form\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"multipart/form-data\",\"example\":\"multipart/form-data\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":false,\"status\":\"done\",\"desc\":\"

\"}]", yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 3]).toJson()!!.toUnixString() ) assertEquals( - "[{\"res_body\":\"{\\n \\\"code\\\": \\\"200\\\", //response code\\n \\\"msg\\\": \\\"ok\\\", //message\\n \\\"data\\\": { //response data\\n \\\"intArr\\\": [\\n \\\"666\\\",\\n \\\"666\\\"\\n ],\\n \\\"amount\\\": {\\n \\\"abc\\\": \\\"str\\\",\\n \\\"def\\\": \\\"str\\\"\\n },\\n \\\"strings\\\": [\\n \\\"str\\\",\\n \\\"str\\\"\\n ],\\n \\\"invalid\\\": [\\n \\\"str\\\"\\n ],\\n \\\"model\\\": {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": \\\"str\\\", //stringList field\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": [ //stringList field\\n \\\"str\\\"\\n ],\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ]\\n }\\n ]\\n }\\n}\",\"query_path\":{\"path\":\"/default/body\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"json\",\"res_body_type\":\"json\",\"index\":0,\"req_body_other\":\"{\\n \\\"intArr\\\": [\\n \\\"666\\\",\\n \\\"666\\\"\\n ],\\n \\\"amount\\\": {\\n \\\"abc\\\": \\\"str\\\",\\n \\\"def\\\": \\\"str\\\"\\n },\\n \\\"strings\\\": [\\n \\\"str\\\",\\n \\\"str\\\"\\n ],\\n \\\"invalid\\\": [\\n \\\"str\\\"\\n ],\\n \\\"model\\\": {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": \\\"str\\\", //stringList field\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": [ //stringList field\\n \\\"str\\\"\\n ],\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ]\\n }\\n ]\\n}\",\"type\":\"static\",\"title\":\"call with body\",\"req_body_form\":[],\"path\":\"/default/body\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"application/json\",\"example\":\"application/json\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":false,\"status\":\"done\",\"desc\":\"

\"}]", + "[{\"res_body\":\"{\\n \\\"code\\\": \\\"200\\\", //response code\\n \\\"msg\\\": \\\"ok\\\", //message\\n \\\"data\\\": { //response data\\n \\\"intArr\\\": [\\n \\\"666\\\",\\n \\\"666\\\"\\n ],\\n \\\"amount\\\": {\\n \\\"abc\\\": \\\"str\\\",\\n \\\"def\\\": \\\"str\\\"\\n },\\n \\\"strings\\\": [\\n \\\"str\\\",\\n \\\"str\\\"\\n ],\\n \\\"invalid\\\": [\\n \\\"str\\\"\\n ],\\n \\\"model\\\": {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": \\\"str\\\", //stringList field\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"shouldIgnore\\\": \\\"str\\\",\\n \\\"shouldIgnoreByGetter\\\": \\\"str\\\",\\n \\\"shouldIgnoreBySetter\\\": \\\"str\\\",\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": [ //stringList field\\n \\\"str\\\"\\n ],\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"shouldIgnore\\\": \\\"str\\\",\\n \\\"shouldIgnoreByGetter\\\": \\\"str\\\",\\n \\\"shouldIgnoreBySetter\\\": \\\"str\\\"\\n }\\n ]\\n }\\n}\",\"query_path\":{\"path\":\"/default/body\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"json\",\"res_body_type\":\"json\",\"index\":0,\"req_body_other\":\"{\\n \\\"intArr\\\": [\\n \\\"666\\\",\\n \\\"666\\\"\\n ],\\n \\\"amount\\\": {\\n \\\"abc\\\": \\\"str\\\",\\n \\\"def\\\": \\\"str\\\"\\n },\\n \\\"strings\\\": [\\n \\\"str\\\",\\n \\\"str\\\"\\n ],\\n \\\"invalid\\\": [\\n \\\"str\\\"\\n ],\\n \\\"model\\\": {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": \\\"str\\\", //stringList field\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"shouldIgnore\\\": \\\"str\\\",\\n \\\"shouldIgnoreByGetter\\\": \\\"str\\\",\\n \\\"shouldIgnoreBySetter\\\": \\\"str\\\",\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": [ //stringList field\\n \\\"str\\\"\\n ],\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"shouldIgnore\\\": \\\"str\\\",\\n \\\"shouldIgnoreByGetter\\\": \\\"str\\\",\\n \\\"shouldIgnoreBySetter\\\": \\\"str\\\"\\n }\\n ]\\n}\",\"type\":\"static\",\"title\":\"call with body\",\"req_body_form\":[],\"path\":\"/default/body\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"application/json\",\"example\":\"application/json\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":false,\"status\":\"done\",\"desc\":\"

\"}]", yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 4]).toJson()!!.toUnixString() ) } @@ -269,15 +269,15 @@ internal abstract class YapiFormatterTest : YapiSpringClassExporterBaseTest() { yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 1]).toJson() ) assertEquals( - "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"},\\\"aaa\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"ddd\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/query\",\"params\":[]},\"method\":\"GET\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with query\",\"path\":\"/default/query\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[{\"name\":\"intArr[0]\",\"value\":123,\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"intArr[1]\",\"value\":456,\"example\":\"456\",\"desc\":\"\",\"required\":0},{\"name\":\"intArr[2]\",\"value\":666,\"example\":\"666\",\"desc\":\"\",\"required\":0},{\"name\":\"intArr[3]\",\"value\":888,\"example\":\"888\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.abc\",\"value\":\"123\",\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.def\",\"value\":\"456\",\"example\":\"456\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.aaa\",\"value\":\"666\",\"example\":\"666\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.ddd\",\"value\":\"888\",\"example\":\"888\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[0]\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[1]\",\"value\":\"123\",\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[2]\",\"value\":\"aaa\",\"example\":\"aaa\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[3]\",\"value\":\"666\",\"example\":\"666\",\"desc\":\"\",\"required\":0},{\"name\":\"invalid[0]\",\"value\":\"\",\"example\":\"{\\\"aaa\\\",\\\"666\\\"]\",\"desc\":\"\",\"required\":0},{\"name\":\"model.str\",\"value\":\"\",\"desc\":\"string field\",\"required\":0},{\"name\":\"model.integer\",\"value\":0,\"desc\":\"integer field\",\"required\":0},{\"name\":\"model.stringList\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"stringList field\",\"required\":0},{\"name\":\"model.integerArray[0]\",\"value\":0,\"desc\":\"integerArray field\",\"required\":0},{\"name\":\"model.s\",\"value\":\"aaa\",\"example\":\"aaa\",\"desc\":\"\",\"required\":0},{\"name\":\"model.s2\",\"value\":\"bbb\",\"example\":\"bbb\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[0].str\",\"value\":\"\",\"desc\":\"string field\",\"required\":0},{\"name\":\"modelList[0].integer\",\"value\":0,\"desc\":\"integer field\",\"required\":0},{\"name\":\"modelList[0].stringList[0]\",\"value\":\"\",\"desc\":\"stringList field\",\"required\":0},{\"name\":\"modelList[0].integerArray[0]\",\"value\":0,\"desc\":\"integerArray field\",\"required\":0},{\"name\":\"modelList[1].s\",\"value\":\"aaa\",\"example\":\"aaa\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[1].s2\",\"value\":\"bbb\",\"example\":\"bbb\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[1].stringList\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"\",\"required\":0}],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", + "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"},\\\"aaa\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"ddd\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/query\",\"params\":[]},\"method\":\"GET\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with query\",\"path\":\"/default/query\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[{\"name\":\"intArr[0]\",\"value\":123,\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"intArr[1]\",\"value\":456,\"example\":\"456\",\"desc\":\"\",\"required\":0},{\"name\":\"intArr[2]\",\"value\":666,\"example\":\"666\",\"desc\":\"\",\"required\":0},{\"name\":\"intArr[3]\",\"value\":888,\"example\":\"888\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.abc\",\"value\":\"123\",\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.def\",\"value\":\"456\",\"example\":\"456\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.aaa\",\"value\":\"666\",\"example\":\"666\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.ddd\",\"value\":\"888\",\"example\":\"888\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[0]\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[1]\",\"value\":\"123\",\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[2]\",\"value\":\"aaa\",\"example\":\"aaa\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[3]\",\"value\":\"666\",\"example\":\"666\",\"desc\":\"\",\"required\":0},{\"name\":\"invalid[0]\",\"value\":\"\",\"example\":\"{\\\"aaa\\\",\\\"666\\\"]\",\"desc\":\"\",\"required\":0},{\"name\":\"model.str\",\"value\":\"\",\"desc\":\"string field\",\"required\":0},{\"name\":\"model.integer\",\"value\":0,\"desc\":\"integer field\",\"required\":0},{\"name\":\"model.stringList\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"stringList field\",\"required\":0},{\"name\":\"model.integerArray[0]\",\"value\":0,\"desc\":\"integerArray field\",\"required\":0},{\"name\":\"model.shouldIgnore\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"model.shouldIgnoreByGetter\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"model.shouldIgnoreBySetter\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"model.s\",\"value\":\"aaa\",\"example\":\"aaa\",\"desc\":\"\",\"required\":0},{\"name\":\"model.s2\",\"value\":\"bbb\",\"example\":\"bbb\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[0].str\",\"value\":\"\",\"desc\":\"string field\",\"required\":0},{\"name\":\"modelList[0].integer\",\"value\":0,\"desc\":\"integer field\",\"required\":0},{\"name\":\"modelList[0].stringList[0]\",\"value\":\"\",\"desc\":\"stringList field\",\"required\":0},{\"name\":\"modelList[0].integerArray[0]\",\"value\":0,\"desc\":\"integerArray field\",\"required\":0},{\"name\":\"modelList[0].shouldIgnore\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[0].shouldIgnoreByGetter\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[0].shouldIgnoreBySetter\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[1].s\",\"value\":\"aaa\",\"example\":\"aaa\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[1].s2\",\"value\":\"bbb\",\"example\":\"bbb\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[1].stringList\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"\",\"required\":0}],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 2]).toJson() ) assertEquals( - "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"},\\\"aaa\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"ddd\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/form\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"form\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with form\",\"req_body_form\":[{\"name\":\"intArr[0]\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"intArr[1]\",\"example\":\"456\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"intArr[2]\",\"example\":\"666\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"intArr[3]\",\"example\":\"888\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.abc\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.def\",\"example\":\"456\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.aaa\",\"example\":\"666\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.ddd\",\"example\":\"888\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[0]\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[1]\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[2]\",\"example\":\"aaa\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[3]\",\"example\":\"666\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"invalid[0]\",\"example\":\"{\\\"aaa\\\",\\\"666\\\"]\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.str\",\"type\":\"text\",\"required\":0,\"desc\":\"string field\"},{\"name\":\"model.integer\",\"type\":\"text\",\"required\":0,\"desc\":\"integer field\"},{\"name\":\"model.stringList\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"stringList field\"},{\"name\":\"model.integerArray[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"integerArray field\"},{\"name\":\"model.s\",\"example\":\"aaa\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.s2\",\"example\":\"bbb\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[0].str\",\"type\":\"text\",\"required\":0,\"desc\":\"string field\"},{\"name\":\"modelList[0].integer\",\"type\":\"text\",\"required\":0,\"desc\":\"integer field\"},{\"name\":\"modelList[0].stringList[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"stringList field\"},{\"name\":\"modelList[0].integerArray[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"integerArray field\"},{\"name\":\"modelList[1].s\",\"example\":\"aaa\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[1].s2\",\"example\":\"bbb\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[1].stringList\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"\"}],\"path\":\"/default/form\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"multipart/form-data\",\"example\":\"multipart/form-data\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", + "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"},\\\"aaa\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"ddd\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/form\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"form\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with form\",\"req_body_form\":[{\"name\":\"intArr[0]\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"intArr[1]\",\"example\":\"456\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"intArr[2]\",\"example\":\"666\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"intArr[3]\",\"example\":\"888\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.abc\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.def\",\"example\":\"456\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.aaa\",\"example\":\"666\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.ddd\",\"example\":\"888\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[0]\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[1]\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[2]\",\"example\":\"aaa\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[3]\",\"example\":\"666\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"invalid[0]\",\"example\":\"{\\\"aaa\\\",\\\"666\\\"]\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.str\",\"type\":\"text\",\"required\":0,\"desc\":\"string field\"},{\"name\":\"model.integer\",\"type\":\"text\",\"required\":0,\"desc\":\"integer field\"},{\"name\":\"model.stringList\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"stringList field\"},{\"name\":\"model.integerArray[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"integerArray field\"},{\"name\":\"model.shouldIgnore\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.shouldIgnoreByGetter\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.shouldIgnoreBySetter\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.s\",\"example\":\"aaa\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.s2\",\"example\":\"bbb\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[0].str\",\"type\":\"text\",\"required\":0,\"desc\":\"string field\"},{\"name\":\"modelList[0].integer\",\"type\":\"text\",\"required\":0,\"desc\":\"integer field\"},{\"name\":\"modelList[0].stringList[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"stringList field\"},{\"name\":\"modelList[0].integerArray[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"integerArray field\"},{\"name\":\"modelList[0].shouldIgnore\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[0].shouldIgnoreByGetter\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[0].shouldIgnoreBySetter\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[1].s\",\"example\":\"aaa\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[1].s2\",\"example\":\"bbb\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[1].stringList\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"\"}],\"path\":\"/default/form\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"multipart/form-data\",\"example\":\"multipart/form-data\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 3]).toJson() ) assertEquals( - "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"},\\\"aaa\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"ddd\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/body\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"json\",\"res_body_type\":\"json\",\"index\":0,\"req_body_other\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"},\\\"aaa\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"ddd\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"type\":\"static\",\"title\":\"call with body\",\"req_body_form\":[],\"path\":\"/default/body\",\"req_body_is_json_schema\":true,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"application/json\",\"example\":\"application/json\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", + "[{\"res_body\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"code\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"200\\\"},\\\"description\\\":\\\"response code\\\"},\\\"msg\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"ok\\\"},\\\"description\\\":\\\"message\\\"},\\\"data\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"},\\\"aaa\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"ddd\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"description\\\":\\\"response data\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"query_path\":{\"path\":\"/default/body\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"json\",\"res_body_type\":\"json\",\"index\":0,\"req_body_other\":\"{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"intArr\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[123, 456]\\\"},\\\"amount\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"abc\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"123\\\"},\\\"def\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"456\\\"},\\\"aaa\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"ddd\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"abc\\\\\\\":\\\\\\\"123\\\\\\\",\\\\\\\"def\\\\\\\":\\\\\\\"456\\\\\\\"}\\\"},\\\"strings\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"]\\\"},\\\"invalid\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[\\\\\\\"abc\\\\\\\",\\\\\\\"123\\\\\\\"}\\\"},\\\"model\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"stringList field\\\",\\\"default\\\":\\\"abc\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"s\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"aaa\\\"},\\\"s2\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"default\\\":\\\"bbb\\\"}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}\\\"},\\\"modelList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"object\\\",\\\"properties\\\":{\\\"str\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"string field\\\"},\\\"integer\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"},\\\"description\\\":\\\"integer field\\\"},\\\"stringList\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"}},\\\"description\\\":\\\"stringList field\\\"},\\\"integerArray\\\":{\\\"type\\\":\\\"array\\\",\\\"items\\\":{\\\"type\\\":\\\"integer\\\",\\\"mock\\\":{\\\"mock\\\":\\\"666\\\"}},\\\"description\\\":\\\"integerArray field\\\"},\\\"shouldIgnore\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreByGetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"shouldIgnoreBySetter\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"}}},\\\"description\\\":\\\"\\\",\\\"default\\\":\\\"[{\\\\\\\"s\\\\\\\":\\\\\\\"aaa\\\\\\\",\\\\\\\"s2\\\\\\\":\\\\\\\"bbb\\\\\\\",\\\\\\\"stringList\\\\\\\":\\\\\\\"abc\\\\\\\"}}\\\"}},\\\"\$schema\\\":\\\"http://json-schema.org/draft-04/schema#\\\"}\",\"type\":\"static\",\"title\":\"call with body\",\"req_body_form\":[],\"path\":\"/default/body\",\"req_body_is_json_schema\":true,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"application/json\",\"example\":\"application/json\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":true,\"status\":\"done\",\"desc\":\"

\"}]", yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 4]).toJson() ) } @@ -322,15 +322,15 @@ internal abstract class YapiFormatterTest : YapiSpringClassExporterBaseTest() { yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 1]).toJson()!!.toUnixString() ) assertEquals( - "[{\"res_body\":\"{\\n \\\"code\\\": \\\"200\\\", //response code\\n \\\"msg\\\": \\\"ok\\\", //message\\n \\\"data\\\": { //response data\\n \\\"intArr\\\": [\\n \\\"666\\\",\\n \\\"666\\\",\\n \\\"666\\\",\\n \\\"666\\\"\\n ],\\n \\\"amount\\\": {\\n \\\"abc\\\": \\\"str\\\",\\n \\\"def\\\": \\\"str\\\",\\n \\\"aaa\\\": \\\"str\\\",\\n \\\"ddd\\\": \\\"str\\\"\\n },\\n \\\"strings\\\": [\\n \\\"str\\\",\\n \\\"str\\\",\\n \\\"str\\\",\\n \\\"str\\\"\\n ],\\n \\\"invalid\\\": [\\n \\\"str\\\"\\n ],\\n \\\"model\\\": {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": \\\"str\\\", //stringList field\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": [ //stringList field\\n \\\"str\\\"\\n ],\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ]\\n },\\n {\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\",\\n \\\"stringList\\\": \\\"str\\\"\\n }\\n ]\\n }\\n}\",\"query_path\":{\"path\":\"/default/query\",\"params\":[]},\"method\":\"GET\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with query\",\"path\":\"/default/query\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[{\"name\":\"intArr[0]\",\"value\":123,\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"intArr[1]\",\"value\":456,\"example\":\"456\",\"desc\":\"\",\"required\":0},{\"name\":\"intArr[2]\",\"value\":666,\"example\":\"666\",\"desc\":\"\",\"required\":0},{\"name\":\"intArr[3]\",\"value\":888,\"example\":\"888\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.abc\",\"value\":\"123\",\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.def\",\"value\":\"456\",\"example\":\"456\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.aaa\",\"value\":\"666\",\"example\":\"666\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.ddd\",\"value\":\"888\",\"example\":\"888\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[0]\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[1]\",\"value\":\"123\",\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[2]\",\"value\":\"aaa\",\"example\":\"aaa\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[3]\",\"value\":\"666\",\"example\":\"666\",\"desc\":\"\",\"required\":0},{\"name\":\"invalid[0]\",\"value\":\"\",\"example\":\"{\\\"aaa\\\",\\\"666\\\"]\",\"desc\":\"\",\"required\":0},{\"name\":\"model.str\",\"value\":\"\",\"desc\":\"string field\",\"required\":0},{\"name\":\"model.integer\",\"value\":0,\"desc\":\"integer field\",\"required\":0},{\"name\":\"model.stringList\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"stringList field\",\"required\":0},{\"name\":\"model.integerArray[0]\",\"value\":0,\"desc\":\"integerArray field\",\"required\":0},{\"name\":\"model.s\",\"value\":\"aaa\",\"example\":\"aaa\",\"desc\":\"\",\"required\":0},{\"name\":\"model.s2\",\"value\":\"bbb\",\"example\":\"bbb\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[0].str\",\"value\":\"\",\"desc\":\"string field\",\"required\":0},{\"name\":\"modelList[0].integer\",\"value\":0,\"desc\":\"integer field\",\"required\":0},{\"name\":\"modelList[0].stringList[0]\",\"value\":\"\",\"desc\":\"stringList field\",\"required\":0},{\"name\":\"modelList[0].integerArray[0]\",\"value\":0,\"desc\":\"integerArray field\",\"required\":0},{\"name\":\"modelList[1].s\",\"value\":\"aaa\",\"example\":\"aaa\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[1].s2\",\"value\":\"bbb\",\"example\":\"bbb\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[1].stringList\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"\",\"required\":0}],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":false,\"status\":\"done\",\"desc\":\"

\"}]", + "[{\"res_body\":\"{\\n \\\"code\\\": \\\"200\\\", //response code\\n \\\"msg\\\": \\\"ok\\\", //message\\n \\\"data\\\": { //response data\\n \\\"intArr\\\": [\\n \\\"666\\\",\\n \\\"666\\\",\\n \\\"666\\\",\\n \\\"666\\\"\\n ],\\n \\\"amount\\\": {\\n \\\"abc\\\": \\\"str\\\",\\n \\\"def\\\": \\\"str\\\",\\n \\\"aaa\\\": \\\"str\\\",\\n \\\"ddd\\\": \\\"str\\\"\\n },\\n \\\"strings\\\": [\\n \\\"str\\\",\\n \\\"str\\\",\\n \\\"str\\\",\\n \\\"str\\\"\\n ],\\n \\\"invalid\\\": [\\n \\\"str\\\"\\n ],\\n \\\"model\\\": {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": \\\"str\\\", //stringList field\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"shouldIgnore\\\": \\\"str\\\",\\n \\\"shouldIgnoreByGetter\\\": \\\"str\\\",\\n \\\"shouldIgnoreBySetter\\\": \\\"str\\\",\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": [ //stringList field\\n \\\"str\\\"\\n ],\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"shouldIgnore\\\": \\\"str\\\",\\n \\\"shouldIgnoreByGetter\\\": \\\"str\\\",\\n \\\"shouldIgnoreBySetter\\\": \\\"str\\\"\\n },\\n {\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\",\\n \\\"stringList\\\": \\\"str\\\"\\n }\\n ]\\n }\\n}\",\"query_path\":{\"path\":\"/default/query\",\"params\":[]},\"method\":\"GET\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with query\",\"path\":\"/default/query\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[{\"name\":\"intArr[0]\",\"value\":123,\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"intArr[1]\",\"value\":456,\"example\":\"456\",\"desc\":\"\",\"required\":0},{\"name\":\"intArr[2]\",\"value\":666,\"example\":\"666\",\"desc\":\"\",\"required\":0},{\"name\":\"intArr[3]\",\"value\":888,\"example\":\"888\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.abc\",\"value\":\"123\",\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.def\",\"value\":\"456\",\"example\":\"456\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.aaa\",\"value\":\"666\",\"example\":\"666\",\"desc\":\"\",\"required\":0},{\"name\":\"amount.ddd\",\"value\":\"888\",\"example\":\"888\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[0]\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[1]\",\"value\":\"123\",\"example\":\"123\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[2]\",\"value\":\"aaa\",\"example\":\"aaa\",\"desc\":\"\",\"required\":0},{\"name\":\"strings[3]\",\"value\":\"666\",\"example\":\"666\",\"desc\":\"\",\"required\":0},{\"name\":\"invalid[0]\",\"value\":\"\",\"example\":\"{\\\"aaa\\\",\\\"666\\\"]\",\"desc\":\"\",\"required\":0},{\"name\":\"model.str\",\"value\":\"\",\"desc\":\"string field\",\"required\":0},{\"name\":\"model.integer\",\"value\":0,\"desc\":\"integer field\",\"required\":0},{\"name\":\"model.stringList\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"stringList field\",\"required\":0},{\"name\":\"model.integerArray[0]\",\"value\":0,\"desc\":\"integerArray field\",\"required\":0},{\"name\":\"model.shouldIgnore\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"model.shouldIgnoreByGetter\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"model.shouldIgnoreBySetter\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"model.s\",\"value\":\"aaa\",\"example\":\"aaa\",\"desc\":\"\",\"required\":0},{\"name\":\"model.s2\",\"value\":\"bbb\",\"example\":\"bbb\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[0].str\",\"value\":\"\",\"desc\":\"string field\",\"required\":0},{\"name\":\"modelList[0].integer\",\"value\":0,\"desc\":\"integer field\",\"required\":0},{\"name\":\"modelList[0].stringList[0]\",\"value\":\"\",\"desc\":\"stringList field\",\"required\":0},{\"name\":\"modelList[0].integerArray[0]\",\"value\":0,\"desc\":\"integerArray field\",\"required\":0},{\"name\":\"modelList[0].shouldIgnore\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[0].shouldIgnoreByGetter\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[0].shouldIgnoreBySetter\",\"value\":\"\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[1].s\",\"value\":\"aaa\",\"example\":\"aaa\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[1].s2\",\"value\":\"bbb\",\"example\":\"bbb\",\"desc\":\"\",\"required\":0},{\"name\":\"modelList[1].stringList\",\"value\":\"abc\",\"example\":\"abc\",\"desc\":\"\",\"required\":0}],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":false,\"status\":\"done\",\"desc\":\"

\"}]", yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 2]).toJson()!!.toUnixString() ) assertEquals( - "[{\"res_body\":\"{\\n \\\"code\\\": \\\"200\\\", //response code\\n \\\"msg\\\": \\\"ok\\\", //message\\n \\\"data\\\": { //response data\\n \\\"intArr\\\": [\\n \\\"666\\\",\\n \\\"666\\\",\\n \\\"666\\\",\\n \\\"666\\\"\\n ],\\n \\\"amount\\\": {\\n \\\"abc\\\": \\\"str\\\",\\n \\\"def\\\": \\\"str\\\",\\n \\\"aaa\\\": \\\"str\\\",\\n \\\"ddd\\\": \\\"str\\\"\\n },\\n \\\"strings\\\": [\\n \\\"str\\\",\\n \\\"str\\\",\\n \\\"str\\\",\\n \\\"str\\\"\\n ],\\n \\\"invalid\\\": [\\n \\\"str\\\"\\n ],\\n \\\"model\\\": {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": \\\"str\\\", //stringList field\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": [ //stringList field\\n \\\"str\\\"\\n ],\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ]\\n },\\n {\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\",\\n \\\"stringList\\\": \\\"str\\\"\\n }\\n ]\\n }\\n}\",\"query_path\":{\"path\":\"/default/form\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"form\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with form\",\"req_body_form\":[{\"name\":\"intArr[0]\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"intArr[1]\",\"example\":\"456\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"intArr[2]\",\"example\":\"666\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"intArr[3]\",\"example\":\"888\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.abc\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.def\",\"example\":\"456\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.aaa\",\"example\":\"666\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.ddd\",\"example\":\"888\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[0]\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[1]\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[2]\",\"example\":\"aaa\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[3]\",\"example\":\"666\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"invalid[0]\",\"example\":\"{\\\"aaa\\\",\\\"666\\\"]\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.str\",\"type\":\"text\",\"required\":0,\"desc\":\"string field\"},{\"name\":\"model.integer\",\"type\":\"text\",\"required\":0,\"desc\":\"integer field\"},{\"name\":\"model.stringList\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"stringList field\"},{\"name\":\"model.integerArray[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"integerArray field\"},{\"name\":\"model.s\",\"example\":\"aaa\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.s2\",\"example\":\"bbb\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[0].str\",\"type\":\"text\",\"required\":0,\"desc\":\"string field\"},{\"name\":\"modelList[0].integer\",\"type\":\"text\",\"required\":0,\"desc\":\"integer field\"},{\"name\":\"modelList[0].stringList[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"stringList field\"},{\"name\":\"modelList[0].integerArray[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"integerArray field\"},{\"name\":\"modelList[1].s\",\"example\":\"aaa\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[1].s2\",\"example\":\"bbb\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[1].stringList\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"\"}],\"path\":\"/default/form\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"multipart/form-data\",\"example\":\"multipart/form-data\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":false,\"status\":\"done\",\"desc\":\"

\"}]", + "[{\"res_body\":\"{\\n \\\"code\\\": \\\"200\\\", //response code\\n \\\"msg\\\": \\\"ok\\\", //message\\n \\\"data\\\": { //response data\\n \\\"intArr\\\": [\\n \\\"666\\\",\\n \\\"666\\\",\\n \\\"666\\\",\\n \\\"666\\\"\\n ],\\n \\\"amount\\\": {\\n \\\"abc\\\": \\\"str\\\",\\n \\\"def\\\": \\\"str\\\",\\n \\\"aaa\\\": \\\"str\\\",\\n \\\"ddd\\\": \\\"str\\\"\\n },\\n \\\"strings\\\": [\\n \\\"str\\\",\\n \\\"str\\\",\\n \\\"str\\\",\\n \\\"str\\\"\\n ],\\n \\\"invalid\\\": [\\n \\\"str\\\"\\n ],\\n \\\"model\\\": {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": \\\"str\\\", //stringList field\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"shouldIgnore\\\": \\\"str\\\",\\n \\\"shouldIgnoreByGetter\\\": \\\"str\\\",\\n \\\"shouldIgnoreBySetter\\\": \\\"str\\\",\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": [ //stringList field\\n \\\"str\\\"\\n ],\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"shouldIgnore\\\": \\\"str\\\",\\n \\\"shouldIgnoreByGetter\\\": \\\"str\\\",\\n \\\"shouldIgnoreBySetter\\\": \\\"str\\\"\\n },\\n {\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\",\\n \\\"stringList\\\": \\\"str\\\"\\n }\\n ]\\n }\\n}\",\"query_path\":{\"path\":\"/default/form\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"form\",\"res_body_type\":\"json\",\"index\":0,\"type\":\"static\",\"title\":\"call with form\",\"req_body_form\":[{\"name\":\"intArr[0]\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"intArr[1]\",\"example\":\"456\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"intArr[2]\",\"example\":\"666\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"intArr[3]\",\"example\":\"888\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.abc\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.def\",\"example\":\"456\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.aaa\",\"example\":\"666\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"amount.ddd\",\"example\":\"888\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[0]\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[1]\",\"example\":\"123\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[2]\",\"example\":\"aaa\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"strings[3]\",\"example\":\"666\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"invalid[0]\",\"example\":\"{\\\"aaa\\\",\\\"666\\\"]\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.str\",\"type\":\"text\",\"required\":0,\"desc\":\"string field\"},{\"name\":\"model.integer\",\"type\":\"text\",\"required\":0,\"desc\":\"integer field\"},{\"name\":\"model.stringList\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"stringList field\"},{\"name\":\"model.integerArray[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"integerArray field\"},{\"name\":\"model.shouldIgnore\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.shouldIgnoreByGetter\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.shouldIgnoreBySetter\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.s\",\"example\":\"aaa\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"model.s2\",\"example\":\"bbb\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[0].str\",\"type\":\"text\",\"required\":0,\"desc\":\"string field\"},{\"name\":\"modelList[0].integer\",\"type\":\"text\",\"required\":0,\"desc\":\"integer field\"},{\"name\":\"modelList[0].stringList[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"stringList field\"},{\"name\":\"modelList[0].integerArray[0]\",\"type\":\"text\",\"required\":0,\"desc\":\"integerArray field\"},{\"name\":\"modelList[0].shouldIgnore\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[0].shouldIgnoreByGetter\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[0].shouldIgnoreBySetter\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[1].s\",\"example\":\"aaa\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[1].s2\",\"example\":\"bbb\",\"type\":\"text\",\"required\":0,\"desc\":\"\"},{\"name\":\"modelList[1].stringList\",\"example\":\"abc\",\"type\":\"text\",\"required\":0,\"desc\":\"\"}],\"path\":\"/default/form\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"multipart/form-data\",\"example\":\"multipart/form-data\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":false,\"status\":\"done\",\"desc\":\"

\"}]", yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 3]).toJson()!!.toUnixString() ) assertEquals( - "[{\"res_body\":\"{\\n \\\"code\\\": \\\"200\\\", //response code\\n \\\"msg\\\": \\\"ok\\\", //message\\n \\\"data\\\": { //response data\\n \\\"intArr\\\": [\\n \\\"666\\\",\\n \\\"666\\\",\\n \\\"666\\\",\\n \\\"666\\\"\\n ],\\n \\\"amount\\\": {\\n \\\"abc\\\": \\\"str\\\",\\n \\\"def\\\": \\\"str\\\",\\n \\\"aaa\\\": \\\"str\\\",\\n \\\"ddd\\\": \\\"str\\\"\\n },\\n \\\"strings\\\": [\\n \\\"str\\\",\\n \\\"str\\\",\\n \\\"str\\\",\\n \\\"str\\\"\\n ],\\n \\\"invalid\\\": [\\n \\\"str\\\"\\n ],\\n \\\"model\\\": {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": \\\"str\\\", //stringList field\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": [ //stringList field\\n \\\"str\\\"\\n ],\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ]\\n },\\n {\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\",\\n \\\"stringList\\\": \\\"str\\\"\\n }\\n ]\\n }\\n}\",\"query_path\":{\"path\":\"/default/body\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"json\",\"res_body_type\":\"json\",\"index\":0,\"req_body_other\":\"{\\n \\\"intArr\\\": [\\n \\\"666\\\",\\n \\\"666\\\",\\n \\\"666\\\",\\n \\\"666\\\"\\n ],\\n \\\"amount\\\": {\\n \\\"abc\\\": \\\"str\\\",\\n \\\"def\\\": \\\"str\\\",\\n \\\"aaa\\\": \\\"str\\\",\\n \\\"ddd\\\": \\\"str\\\"\\n },\\n \\\"strings\\\": [\\n \\\"str\\\",\\n \\\"str\\\",\\n \\\"str\\\",\\n \\\"str\\\"\\n ],\\n \\\"invalid\\\": [\\n \\\"str\\\"\\n ],\\n \\\"model\\\": {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": \\\"str\\\", //stringList field\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": [ //stringList field\\n \\\"str\\\"\\n ],\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ]\\n },\\n {\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\",\\n \\\"stringList\\\": \\\"str\\\"\\n }\\n ]\\n}\",\"type\":\"static\",\"title\":\"call with body\",\"req_body_form\":[],\"path\":\"/default/body\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"application/json\",\"example\":\"application/json\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":false,\"status\":\"done\",\"desc\":\"

\"}]", + "[{\"res_body\":\"{\\n \\\"code\\\": \\\"200\\\", //response code\\n \\\"msg\\\": \\\"ok\\\", //message\\n \\\"data\\\": { //response data\\n \\\"intArr\\\": [\\n \\\"666\\\",\\n \\\"666\\\",\\n \\\"666\\\",\\n \\\"666\\\"\\n ],\\n \\\"amount\\\": {\\n \\\"abc\\\": \\\"str\\\",\\n \\\"def\\\": \\\"str\\\",\\n \\\"aaa\\\": \\\"str\\\",\\n \\\"ddd\\\": \\\"str\\\"\\n },\\n \\\"strings\\\": [\\n \\\"str\\\",\\n \\\"str\\\",\\n \\\"str\\\",\\n \\\"str\\\"\\n ],\\n \\\"invalid\\\": [\\n \\\"str\\\"\\n ],\\n \\\"model\\\": {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": \\\"str\\\", //stringList field\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"shouldIgnore\\\": \\\"str\\\",\\n \\\"shouldIgnoreByGetter\\\": \\\"str\\\",\\n \\\"shouldIgnoreBySetter\\\": \\\"str\\\",\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": [ //stringList field\\n \\\"str\\\"\\n ],\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"shouldIgnore\\\": \\\"str\\\",\\n \\\"shouldIgnoreByGetter\\\": \\\"str\\\",\\n \\\"shouldIgnoreBySetter\\\": \\\"str\\\"\\n },\\n {\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\",\\n \\\"stringList\\\": \\\"str\\\"\\n }\\n ]\\n }\\n}\",\"query_path\":{\"path\":\"/default/body\",\"params\":[]},\"method\":\"POST\",\"req_body_type\":\"json\",\"res_body_type\":\"json\",\"index\":0,\"req_body_other\":\"{\\n \\\"intArr\\\": [\\n \\\"666\\\",\\n \\\"666\\\",\\n \\\"666\\\",\\n \\\"666\\\"\\n ],\\n \\\"amount\\\": {\\n \\\"abc\\\": \\\"str\\\",\\n \\\"def\\\": \\\"str\\\",\\n \\\"aaa\\\": \\\"str\\\",\\n \\\"ddd\\\": \\\"str\\\"\\n },\\n \\\"strings\\\": [\\n \\\"str\\\",\\n \\\"str\\\",\\n \\\"str\\\",\\n \\\"str\\\"\\n ],\\n \\\"invalid\\\": [\\n \\\"str\\\"\\n ],\\n \\\"model\\\": {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": \\\"str\\\", //stringList field\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"shouldIgnore\\\": \\\"str\\\",\\n \\\"shouldIgnoreByGetter\\\": \\\"str\\\",\\n \\\"shouldIgnoreBySetter\\\": \\\"str\\\",\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"str\\\": \\\"str\\\", //string field\\n \\\"integer\\\": \\\"666\\\", //integer field\\n \\\"stringList\\\": [ //stringList field\\n \\\"str\\\"\\n ],\\n \\\"integerArray\\\": [ //integerArray field\\n \\\"666\\\"\\n ],\\n \\\"shouldIgnore\\\": \\\"str\\\",\\n \\\"shouldIgnoreByGetter\\\": \\\"str\\\",\\n \\\"shouldIgnoreBySetter\\\": \\\"str\\\"\\n },\\n {\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\",\\n \\\"stringList\\\": \\\"str\\\"\\n }\\n ]\\n}\",\"type\":\"static\",\"title\":\"call with body\",\"req_body_form\":[],\"path\":\"/default/body\",\"req_body_is_json_schema\":false,\"__v\":0,\"markdown\":\"\",\"req_headers\":[{\"name\":\"Content-Type\",\"value\":\"application/json\",\"example\":\"application/json\",\"required\":1},{\"name\":\"token\",\"value\":\"\",\"desc\":\"auth token\",\"example\":\"123456\",\"required\":1}],\"edit_uid\":0,\"up_time\":1618124194,\"tag\":[],\"req_query\":[],\"api_opened\":false,\"add_time\":1618124194,\"res_body_is_json_schema\":false,\"status\":\"done\",\"desc\":\"

\"}]", yapiFormatter.doc2Items(requests[apiCntInUserCtrl + 4]).toJson()!!.toUnixString() ) } diff --git a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/api/export/yapi/YapiPsiClassHelperTest.kt b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/api/export/yapi/YapiPsiClassHelperTest.kt index 723d60c5b..a3ec7c664 100644 --- a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/api/export/yapi/YapiPsiClassHelperTest.kt +++ b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/api/export/yapi/YapiPsiClassHelperTest.kt @@ -22,6 +22,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { "field.default.value=#default\n" + "field.mock=#mock\n" + "field.demo=#demo\n" + + "field.ignore=@com.fasterxml.jackson.annotation.JsonIgnore#value\n" + "json.rule.convert[java.time.LocalDateTime]=java.lang.String\n" + "json.rule.convert[java.time.LocalDate]=java.lang.String\n" + "json.additional.field[com.itangcent.model.UserInfo]={\"name\":\"label\",\"defaultValue\":\"genius\",\"type\":\"java.lang.String\",\"desc\":\"label of the user\",\"required\":true,\"mock\":\"@string\",\"demo\":\"genius\",\"advanced\":\"some\"}\n" + @@ -78,7 +79,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0]}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", GsonUtils.toJson(psiClassHelper.getTypeObject(PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass)) ) @@ -168,7 +169,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0]}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass, @@ -177,7 +178,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlyGet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlyGet\":\"\"}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreBySetter\":false,\"onlyGet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreBySetter\":\"\",\"onlyGet\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass, @@ -186,7 +187,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\"}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"onlySet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"onlySet\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass, @@ -281,7 +282,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0]}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", GsonUtils.toJson(psiClassHelper.getTypeObject(SingleDuckType(modelPsiClass), modelPsiClass)) ) @@ -366,7 +367,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0]}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( SingleDuckType(modelPsiClass), modelPsiClass, @@ -375,7 +376,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlyGet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlyGet\":\"\"}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreBySetter\":false,\"onlyGet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreBySetter\":\"\",\"onlyGet\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( SingleDuckType(modelPsiClass), modelPsiClass, @@ -384,7 +385,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\"}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"onlySet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"onlySet\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( SingleDuckType(modelPsiClass), modelPsiClass, @@ -441,11 +442,11 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { //testGetFields------------------------------------------------------------------------------------------------------------ assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0]}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", GsonUtils.toJson(psiClassHelper.getFields(modelPsiClass)) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0]}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", GsonUtils.toJson(psiClassHelper.getFields(modelPsiClass, modelPsiClass)) ) assertEquals( diff --git a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/ScriptClassContextBaseTest.kt b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/ScriptClassContextBaseTest.kt index 28e8310e0..f909ee022 100644 --- a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/ScriptClassContextBaseTest.kt +++ b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/ScriptClassContextBaseTest.kt @@ -1,13 +1,10 @@ package com.itangcent.idea.plugin.rule -import com.google.inject.Inject import com.intellij.psi.PsiClass import com.itangcent.common.kit.toJson import com.itangcent.common.utils.GsonUtils import com.itangcent.idea.plugin.rule.ScriptRuleParser.ScriptClassContext import com.itangcent.intellij.config.rule.RuleParser -import com.itangcent.intellij.context.ActionContext -import com.itangcent.intellij.extend.guice.with import com.itangcent.testFramework.PluginContextLightCodeInsightFixtureTestCase import java.time.LocalDate import java.time.LocalDateTime @@ -17,8 +14,9 @@ import java.time.LocalDateTime */ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixtureTestCase() { - @Inject - internal lateinit var ruleParser: RuleParser + internal val ruleParser: RuleParser by lazy { + actionContext.instance(GroovyRuleParser::class) + } internal lateinit var objectPsiClass: PsiClass internal lateinit var integerPsiClass: PsiClass @@ -38,6 +36,8 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture override fun beforeBind() { super.beforeBind() + loadFile("annotation/JsonProperty.java")!! + loadFile("annotation/JsonIgnore.java")!! objectPsiClass = loadSource(Object::class.java)!! loadSource(java.lang.String::class.java)!! loadSource(java.lang.Number::class.java)!! @@ -66,9 +66,19 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture validationGroupedDemoDtoPsiClass = loadClass("model/ValidationGroupedDemoDto.java")!! } - override fun bind(builder: ActionContext.ActionContextBuilder) { - super.bind(builder) - builder.bind(RuleParser::class) { it.with(GroovyRuleParser::class) } + override fun customConfig(): String? { + return "json.rule.field.name=@com.fasterxml.jackson.annotation.JsonProperty#value\n" + + "field.required=@javax.validation.constraints.NotBlank\n" + + "field.required=@javax.validation.constraints.NotNull\n" + + "field.default.value=#default\n" + + "field.mock=#mock\n" + + "field.demo=#demo\n" + + "field.ignore=@com.fasterxml.jackson.annotation.JsonIgnore#value\n" + + "json.rule.convert[java.time.LocalDateTime]=java.lang.String\n" + + "json.rule.convert[java.time.LocalDate]=java.lang.String\n" + + "json.additional.field[com.itangcent.model.UserInfo]={\"name\":\"label\",\"defaultValue\":\"genius\",\"type\":\"java.lang.String\",\"desc\":\"label of the user\",\"required\":true,\"mock\":\"@string\",\"demo\":\"genius\",\"advanced\":\"some\"}\n" + + "json.additional.field[com.itangcent.model.UserInfo#name]={\"name\":\"firstName\",\"defaultValue\":\"tang\",\"type\":\"java.lang.String\",\"desc\":\"a family name\",\"required\":false,\"mock\":\"@string\",\"demo\":\"tang\",\"advanced\":\"some\"}\n" + + "json.additional.field[com.itangcent.model.UserInfo#age]={\"name\":\"order\",\"defaultValue\":\"12\",\"type\":\"int\",\"desc\":\"order of the age in family\",\"required\":true,\"mock\":\"@int\",\"demo\":\"12\",\"advanced\":\"some\"}" } open fun PsiClass.asClassContext(): ScriptClassContext { @@ -226,6 +236,13 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " */\n" + " private Integer[] integerArray;\n" + "\n" + + " @JsonIgnore\n" + + " private String shouldIgnore;\n" + + "\n" + + " private String shouldIgnoreByGetter;\n" + + "\n" + + " private String shouldIgnoreBySetter;\n" + + "\n" + " public String getStr() {\n" + " return str;\n" + " }\n" + @@ -265,6 +282,32 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " public String getOnlyGet() {\n" + "\n" + " }\n" + + "\n" + + " public String getShouldIgnore() {\n" + + " return shouldIgnore;\n" + + " }\n" + + "\n" + + " public void setShouldIgnore(String shouldIgnore) {\n" + + " this.shouldIgnore = shouldIgnore;\n" + + " }\n" + + "\n" + + " @JsonIgnore\n" + + " public String getShouldIgnoreByGetter() {\n" + + " return shouldIgnoreByGetter;\n" + + " }\n" + + "\n" + + " public void setShouldIgnoreByGetter(String shouldIgnoreByGetter) {\n" + + " this.shouldIgnoreByGetter = shouldIgnoreByGetter;\n" + + " }\n" + + "\n" + + " public String getShouldIgnoreBySetter() {\n" + + " return shouldIgnoreBySetter;\n" + + " }\n" + + "\n" + + " @JsonIgnore\n" + + " public void setShouldIgnoreBySetter(String shouldIgnoreBySetter) {\n" + + " this.shouldIgnoreBySetter = shouldIgnoreBySetter;\n" + + " }\n" + "}", modelPsiClass.asScriptContext().sourceCode() ) assertEquals( @@ -451,14 +494,14 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture fun testFieldCnt() { assertEquals(0, objectPsiClass.asClassContext().fieldCnt()) - assertEquals(4, modelPsiClass.asClassContext().fieldCnt()) + assertEquals(7, modelPsiClass.asClassContext().fieldCnt()) assertEquals(3, resultPsiClass.asClassContext().fieldCnt()) assertEquals(0, iResultPsiClass.asClassContext().fieldCnt()) } fun testMethodCnt() { assertEquals(12, objectPsiClass.asClassContext().methodCnt()) - assertEquals(22, modelPsiClass.asClassContext().methodCnt()) + assertEquals(28, modelPsiClass.asClassContext().methodCnt()) assertEquals(25, resultPsiClass.asClassContext().methodCnt()) assertEquals(14, iResultPsiClass.asClassContext().methodCnt()) } @@ -468,7 +511,7 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture assertEquals( "{\n" + - " \"str\": \"\",\n" + + " \"s\": \"\",\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + " \"\"\n" + @@ -482,7 +525,7 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture ) assertEquals( "{\n" + - " \"str\": \"\",\n" + + " \"s\": \"\",\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + " \"\"\n" + @@ -490,12 +533,13 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " \"integerArray\": [\n" + " 0\n" + " ],\n" + + " \"shouldIgnoreBySetter\": \"\",\n" + " \"onlyGet\": \"\"\n" + "}", modelPsiClass.asClassContext().toJson(true, false) ) assertEquals( "{\n" + - " \"str\": \"\",\n" + + " \"s\": \"\",\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + " \"\"\n" + @@ -503,19 +547,22 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " \"integerArray\": [\n" + " 0\n" + " ],\n" + + " \"shouldIgnoreByGetter\": \"\",\n" + " \"onlySet\": \"\"\n" + "}", modelPsiClass.asClassContext().toJson(false, true) ) assertEquals( "{\n" + - " \"str\": \"\",\n" + + " \"s\": \"\",\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + " \"\"\n" + " ],\n" + " \"integerArray\": [\n" + " 0\n" + - " ]\n" + + " ],\n" + + " \"shouldIgnoreByGetter\": \"\",\n" + + " \"shouldIgnoreBySetter\": \"\"\n" + "}", modelPsiClass.asClassContext().toJson(false, false) ) @@ -619,7 +666,7 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture assertEquals( "{\n" + - " \"str\": \"\", //string field\n" + + " \"s\": \"\", //string field\n" + " \"integer\": 0, //integer field\n" + " \"stringList\": [ //stringList field\n" + " \"\"\n" + @@ -633,7 +680,7 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture ) assertEquals( "{\n" + - " \"str\": \"\", //string field\n" + + " \"s\": \"\", //string field\n" + " \"integer\": 0, //integer field\n" + " \"stringList\": [ //stringList field\n" + " \"\"\n" + @@ -641,12 +688,13 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " \"integerArray\": [ //integerArray field\n" + " 0\n" + " ],\n" + + " \"shouldIgnoreBySetter\": \"\",\n" + " \"onlyGet\": \"\"\n" + "}", modelPsiClass.asClassContext().toJson5(true, false) ) assertEquals( "{\n" + - " \"str\": \"\", //string field\n" + + " \"s\": \"\", //string field\n" + " \"integer\": 0, //integer field\n" + " \"stringList\": [ //stringList field\n" + " \"\"\n" + @@ -654,19 +702,22 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " \"integerArray\": [ //integerArray field\n" + " 0\n" + " ],\n" + + " \"shouldIgnoreByGetter\": \"\",\n" + " \"onlySet\": \"\"\n" + "}", modelPsiClass.asClassContext().toJson5(false, true) ) assertEquals( "{\n" + - " \"str\": \"\", //string field\n" + + " \"s\": \"\", //string field\n" + " \"integer\": 0, //integer field\n" + " \"stringList\": [ //stringList field\n" + " \"\"\n" + " ],\n" + " \"integerArray\": [ //integerArray field\n" + " 0\n" + - " ]\n" + + " ],\n" + + " \"shouldIgnoreByGetter\": \"\",\n" + + " \"shouldIgnoreBySetter\": \"\"\n" + "}", modelPsiClass.asClassContext().toJson5(false, false) ) @@ -776,9 +827,9 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture assertEquals( "{\n" + - " \"str\": \"\",\n" + + " \"s\": \"\",\n" + " \"@comment\": {\n" + - " \"str\": \"string field\",\n" + + " \"s\": \"string field\",\n" + " \"integer\": \"integer field\",\n" + " \"stringList\": \"stringList field\",\n" + " \"integerArray\": \"integerArray field\"\n" + @@ -803,12 +854,13 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture ) assertEquals( "{\n" + - " \"str\": \"\",\n" + + " \"s\": \"\",\n" + " \"@comment\": {\n" + - " \"str\": \"string field\",\n" + + " \"s\": \"string field\",\n" + " \"integer\": \"integer field\",\n" + " \"stringList\": \"stringList field\",\n" + - " \"integerArray\": \"integerArray field\"\n" + + " \"integerArray\": \"integerArray field\",\n" + + " \"shouldIgnoreBySetter\": \"\"\n" + " },\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + @@ -817,6 +869,7 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " \"integerArray\": [\n" + " 0\n" + " ],\n" + + " \"shouldIgnoreBySetter\": \"\",\n" + " \"onlyGet\": \"\"\n" + "}", GsonUtils.prettyJson( @@ -829,12 +882,13 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture ) assertEquals( "{\n" + - " \"str\": \"\",\n" + + " \"s\": \"\",\n" + " \"@comment\": {\n" + - " \"str\": \"string field\",\n" + + " \"s\": \"string field\",\n" + " \"integer\": \"integer field\",\n" + " \"stringList\": \"stringList field\",\n" + - " \"integerArray\": \"integerArray field\"\n" + + " \"integerArray\": \"integerArray field\",\n" + + " \"shouldIgnoreByGetter\": \"\"\n" + " },\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + @@ -843,6 +897,7 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " \"integerArray\": [\n" + " 0\n" + " ],\n" + + " \"shouldIgnoreByGetter\": \"\",\n" + " \"onlySet\": \"\"\n" + "}", GsonUtils.prettyJson( @@ -851,12 +906,14 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture ) assertEquals( "{\n" + - " \"str\": \"\",\n" + + " \"s\": \"\",\n" + " \"@comment\": {\n" + - " \"str\": \"string field\",\n" + + " \"s\": \"string field\",\n" + " \"integer\": \"integer field\",\n" + " \"stringList\": \"stringList field\",\n" + - " \"integerArray\": \"integerArray field\"\n" + + " \"integerArray\": \"integerArray field\",\n" + + " \"shouldIgnoreByGetter\": \"\",\n" + + " \"shouldIgnoreBySetter\": \"\"\n" + " },\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + @@ -864,7 +921,9 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " ],\n" + " \"integerArray\": [\n" + " 0\n" + - " ]\n" + + " ],\n" + + " \"shouldIgnoreByGetter\": \"\",\n" + + " \"shouldIgnoreBySetter\": \"\"\n" + "}", GsonUtils.prettyJson( modelPsiClass.asClassContext().toObject(false, false, true) @@ -873,7 +932,7 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture assertEquals( "{\n" + - " \"str\": \"\",\n" + + " \"s\": \"\",\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + " \"\"\n" + diff --git a/idea-plugin/src/test/kotlin/com/itangcent/idea/utils/ContextualPsiClassHelperBaseTest.kt b/idea-plugin/src/test/kotlin/com/itangcent/idea/utils/ContextualPsiClassHelperBaseTest.kt index 3c29068ec..081b525ee 100644 --- a/idea-plugin/src/test/kotlin/com/itangcent/idea/utils/ContextualPsiClassHelperBaseTest.kt +++ b/idea-plugin/src/test/kotlin/com/itangcent/idea/utils/ContextualPsiClassHelperBaseTest.kt @@ -37,6 +37,7 @@ internal abstract class ContextualPsiClassHelperBaseTest : PluginContextLightCod override fun beforeBind() { super.beforeBind() loadFile("annotation/JsonProperty.java")!! + loadFile("annotation/JsonIgnore.java")!! objectPsiClass = loadSource(Object::class.java)!! integerPsiClass = loadSource(java.lang.Integer::class)!! loadSource(java.lang.Long::class)!! diff --git a/idea-plugin/src/test/kotlin/com/itangcent/idea/utils/CustomizedPsiClassHelperTest.kt b/idea-plugin/src/test/kotlin/com/itangcent/idea/utils/CustomizedPsiClassHelperTest.kt index efa7e3e14..e0259ad3d 100644 --- a/idea-plugin/src/test/kotlin/com/itangcent/idea/utils/CustomizedPsiClassHelperTest.kt +++ b/idea-plugin/src/test/kotlin/com/itangcent/idea/utils/CustomizedPsiClassHelperTest.kt @@ -17,6 +17,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() //language=Properties return "dev=true\n" + "json.rule.field.name=@com.fasterxml.jackson.annotation.JsonProperty#value\n" + + "field.ignore=@com.fasterxml.jackson.annotation.JsonIgnore#value\n" + "field.required=@javax.validation.constraints.NotBlank\n" + "field.required=@javax.validation.constraints.NotNull\n" + "field.default.value=#default\n" + @@ -75,7 +76,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0]}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", GsonUtils.toJson(psiClassHelper.getTypeObject(PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass)) ) @@ -90,7 +91,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) assertEquals( - "{\"intArr\":[123,456],\"@required\":{\"intArr\":false,\"amount\":false,\"strings\":false,\"invalid\":false,\"model\":false,\"modelList\":false},\"@default\":{\"intArr\":\"[123, 456]\",\"amount\":\"{\\\"abc\\\":\\\"123\\\",\\\"def\\\":\\\"456\\\"}\",\"strings\":\"[\\\"abc\\\",\\\"123\\\"]\",\"invalid\":\"[\\\"abc\\\",\\\"123\\\"}\",\"model\":\"{\\\"s\\\":\\\"aaa\\\",\\\"s2\\\":\\\"bbb\\\",\\\"stringList\\\":\\\"abc\\\"}\",\"modelList\":\"[{\\\"s\\\":\\\"aaa\\\",\\\"s2\\\":\\\"bbb\\\",\\\"stringList\\\":\\\"abc\\\"}}\"},\"amount\":{\"abc\":\"123\",\"def\":\"456\",\"@default\":{\"abc\":\"123\",\"def\":\"456\"}},\"strings\":[\"abc\",\"123\"],\"invalid\":[\"\"],\"model\":{\"s\":\"aaa\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false},\"integer\":0,\"stringList\":\"abc\",\"integerArray\":[0],\"s2\":\"bbb\",\"@default\":{\"s\":\"aaa\",\"s2\":\"bbb\",\"stringList\":\"abc\"}},\"modelList\":[{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0]}]}", + "{\"intArr\":[123,456],\"@required\":{\"intArr\":false,\"amount\":false,\"strings\":false,\"invalid\":false,\"model\":false,\"modelList\":false},\"@default\":{\"intArr\":\"[123, 456]\",\"amount\":\"{\\\"abc\\\":\\\"123\\\",\\\"def\\\":\\\"456\\\"}\",\"strings\":\"[\\\"abc\\\",\\\"123\\\"]\",\"invalid\":\"[\\\"abc\\\",\\\"123\\\"}\",\"model\":\"{\\\"s\\\":\\\"aaa\\\",\\\"s2\\\":\\\"bbb\\\",\\\"stringList\\\":\\\"abc\\\"}\",\"modelList\":\"[{\\\"s\\\":\\\"aaa\\\",\\\"s2\\\":\\\"bbb\\\",\\\"stringList\\\":\\\"abc\\\"}}\"},\"amount\":{\"abc\":\"123\",\"def\":\"456\",\"@default\":{\"abc\":\"123\",\"def\":\"456\"}},\"strings\":[\"abc\",\"123\"],\"invalid\":[\"\"],\"model\":{\"s\":\"aaa\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":\"abc\",\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"s2\":\"bbb\",\"@default\":{\"s\":\"aaa\",\"s2\":\"bbb\",\"stringList\":\"abc\"}},\"modelList\":[{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}]}", GsonUtils.toJson( psiClassHelper.getTypeObject( PsiTypesUtil.getClassType(defaultPsiClass), @@ -175,7 +176,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0]}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass, @@ -184,7 +185,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlyGet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlyGet\":\"\"}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreBySetter\":false,\"onlyGet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreBySetter\":\"\",\"onlyGet\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass, @@ -193,7 +194,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\"}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"onlySet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"onlySet\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass, @@ -288,7 +289,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0]}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", GsonUtils.toJson(psiClassHelper.getTypeObject(SingleDuckType(modelPsiClass), modelPsiClass)) ) @@ -373,7 +374,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0]}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( SingleDuckType(modelPsiClass), modelPsiClass, @@ -382,7 +383,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlyGet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlyGet\":\"\"}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreBySetter\":false,\"onlyGet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreBySetter\":\"\",\"onlyGet\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( SingleDuckType(modelPsiClass), modelPsiClass, @@ -391,7 +392,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\"}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"onlySet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"onlySet\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( SingleDuckType(modelPsiClass), modelPsiClass, @@ -448,11 +449,11 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() fun testGetFields() { assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0]}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", GsonUtils.toJson(psiClassHelper.getFields(modelPsiClass)) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0]}", + "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", GsonUtils.toJson(psiClassHelper.getFields(modelPsiClass, modelPsiClass)) ) assertEquals( diff --git a/idea-plugin/src/test/resources/annotation/JsonIgnore.java b/idea-plugin/src/test/resources/annotation/JsonIgnore.java new file mode 100644 index 000000000..dc7aee8e2 --- /dev/null +++ b/idea-plugin/src/test/resources/annotation/JsonIgnore.java @@ -0,0 +1,63 @@ +package com.fasterxml.jackson.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marker annotation that indicates that the logical property that + * the accessor (field, getter/setter method or Creator parameter + * [of {@link JsonCreator}-annotated constructor or factory method]) + * is to be ignored by introspection-based + * serialization and deserialization functionality. + *

+ * Annotation only needs to be added to one of the accessors (often + * getter method, but may be setter, field or creator parameter), + * if the complete removal of the property is desired. + * However: if only particular accessor is to be ignored (for example, + * when ignoring one of potentially conflicting setter methods), + * this can be done by annotating other not-to-be-ignored accessors + * with {@link JsonProperty} (or its equivalents). This is considered + * so-called "split property" case and allows definitions of + * "read-only" (read from input into POJO) and "write-only" (write + * in output but ignore on output) + *
+ * NOTE! As Jackson 2.6, there is a new and improved way to define + * `read-only` and `write-only` properties, using + * {@link JsonProperty#access()} annotation: this is recommended over + * use of separate JsonIgnore and {@link JsonProperty} + * annotations. + *

+ * For example, a "getter" method that would otherwise denote + * a property (like, say, "getValue" to suggest property "value") + * to serialize, would be ignored and no such property would + * be output unless another annotation defines alternative method to use. + *

+ * When ignoring the whole property, the default behavior if encountering + * such property in input is to ignore it without exception; but if there + * is a {@link JsonAnySetter} it will be called instead. Either way, + * no exception will be thrown. + *

+ * Annotation is usually used just a like a marker annotation, that + * is, without explicitly defining 'value' argument (which defaults + * to true): but argument can be explicitly defined. + * This can be done to override an existing `JsonIgnore` by explicitly + * defining one with 'false' argument: either in a sub-class, or by + * using "mix-in annotations". + */ +@Target({ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@JacksonAnnotation +public @interface JsonIgnore +{ + /** + * Optional argument that defines whether this annotation is active + * or not. The only use for value 'false' if for overriding purposes + * (which is not needed often); most likely it is needed for use + * with "mix-in annotations" (aka "annotation overrides"). + * For most cases, however, default value of "true" is just fine + * and should be omitted. + */ + boolean value() default true; +} diff --git a/idea-plugin/src/test/resources/model/Model.java b/idea-plugin/src/test/resources/model/Model.java index 8d4ee13b2..5452f2799 100644 --- a/idea-plugin/src/test/resources/model/Model.java +++ b/idea-plugin/src/test/resources/model/Model.java @@ -1,5 +1,6 @@ package com.itangcent.model; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import java.util.List; @@ -27,6 +28,13 @@ class Model { */ private Integer[] integerArray; + @JsonIgnore + private String shouldIgnore; + + private String shouldIgnoreByGetter; + + private String shouldIgnoreBySetter; + public String getStr() { return str; } @@ -66,4 +74,30 @@ public void setOnlySet(String onlySet) { public String getOnlyGet() { } + + public String getShouldIgnore() { + return shouldIgnore; + } + + public void setShouldIgnore(String shouldIgnore) { + this.shouldIgnore = shouldIgnore; + } + + @JsonIgnore + public String getShouldIgnoreByGetter() { + return shouldIgnoreByGetter; + } + + public void setShouldIgnoreByGetter(String shouldIgnoreByGetter) { + this.shouldIgnoreByGetter = shouldIgnoreByGetter; + } + + public String getShouldIgnoreBySetter() { + return shouldIgnoreBySetter; + } + + @JsonIgnore + public void setShouldIgnoreBySetter(String shouldIgnoreBySetter) { + this.shouldIgnoreBySetter = shouldIgnoreBySetter; + } } \ No newline at end of file