From e624a0beca3e5f0ea123a32f6f2ded25e86c04b9 Mon Sep 17 00:00:00 2001 From: tangcent Date: Thu, 19 Oct 2023 23:04:44 +0800 Subject: [PATCH] feat: Add new rule field.order.with --- gradle.properties | 2 +- .../api/export/core/ClassExportRuleKeys.kt | 5 + .../plugin/dialog/ScriptExecutorDialog.kt | 7 +- .../plugin/rule/FieldPatternRuleParser.kt | 2 +- .../idea/plugin/rule/ScriptRuleParser.kt | 121 ++++++++------ .../idea/plugin/rule/SuvRuleParser.kt | 49 ++---- .../idea/utils/ContextualPsiClassHelper.kt | 41 +++-- .../main/resources/.recommend.easy.api.config | 32 +++- .../idea/plugin/api/export/UrlSelectorTest.kt | 7 +- .../api/export/yapi/YapiFormatterTest.kt | 30 ++-- .../api/export/yapi/YapiPsiClassHelperTest.kt | 42 +++-- .../yapi/YapiSpringClassExporterBaseTest.kt | 17 +- .../plugin/rule/FieldPatternRuleParserTest.kt | 38 ++--- .../idea/plugin/rule/GroovyRuleParserTest.kt | 41 +++-- .../idea/plugin/rule/JsRuleParserTest.kt | 42 +++-- .../plugin/rule/ScriptClassContextBaseTest.kt | 103 +++++++++--- .../plugin/rule/StandardJdkRuleParserTest.kt | 63 ++++---- .../idea/plugin/rule/SuvRuleParserTest.kt | 42 +++-- .../helper/RecommendConfigLoaderTest.kt | 2 +- .../utils/CustomizedPsiClassHelperTest.kt | 148 +++++++++++++++--- .../src/test/resources/model/Model.java | 11 ++ .../src/test/resources/model/SubModel.java | 20 +++ 22 files changed, 574 insertions(+), 291 deletions(-) create mode 100644 idea-plugin/src/test/resources/model/SubModel.java diff --git a/gradle.properties b/gradle.properties index 3e09ca543..af1bdce56 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.7 \ No newline at end of file +itangcent_intellij_version=1.5.8 \ 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 96aa38030..1cd83d608 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 @@ -109,6 +109,11 @@ object ClassExportRuleKeys { BooleanRuleMode.ANY ) + val FIELD_ORDER_WITH: RuleKey = SimpleRuleKey( + "field.order.with", + IntRuleMode + ) + val CLASS_PREFIX_PATH: RuleKey = SimpleRuleKey( "class.prefix.path", StringRuleMode.SINGLE diff --git a/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/dialog/ScriptExecutorDialog.kt b/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/dialog/ScriptExecutorDialog.kt index 1f52b229d..3504d0833 100644 --- a/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/dialog/ScriptExecutorDialog.kt +++ b/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/dialog/ScriptExecutorDialog.kt @@ -23,6 +23,7 @@ import com.itangcent.idea.utils.FileSaveHelper import com.itangcent.idea.utils.FileSelectHelper import com.itangcent.intellij.config.rule.RuleParser import com.itangcent.intellij.config.rule.StringRule +import com.itangcent.intellij.config.rule.parseStringRule import com.itangcent.intellij.context.ActionContext import com.itangcent.intellij.extend.rx.AutoComputer import com.itangcent.intellij.extend.rx.mutual @@ -40,7 +41,6 @@ import java.awt.event.WindowAdapter import java.awt.event.WindowEvent import java.util.* import java.util.Timer -import java.util.concurrent.TimeUnit import java.util.concurrent.atomic.AtomicLong import javax.script.ScriptEngineManager import javax.swing.* @@ -297,12 +297,15 @@ class ScriptExecutorDialog : ContextDialog() { is PsiClass -> { ele } + is PsiElement -> { ele.getContainingClass() } + is ExplicitElement<*> -> { ele.containClass().psi() } + else -> { throw IllegalArgumentException("unknown context:$ele") } @@ -427,7 +430,7 @@ class ScriptExecutorDialog : ContextDialog() { val ret: String? try { val context = scriptInfo.context - ret = parseStringRule.compute( + ret = parseStringRule( when (context) { is ExplicitElement<*> -> ruleParser.contextOf(context) is PsiClass -> ruleParser.contextOf(duckTypeHelper.explicit(context)) diff --git a/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/rule/FieldPatternRuleParser.kt b/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/rule/FieldPatternRuleParser.kt index 15bcb26c4..04e80bf0f 100644 --- a/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/rule/FieldPatternRuleParser.kt +++ b/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/rule/FieldPatternRuleParser.kt @@ -43,7 +43,7 @@ class FieldPatternRule( val pathPredict: (String?) -> Boolean, val typePredict: (String?) -> Boolean, ) : BooleanRule { - override fun compute(context: RuleContext): Boolean { + override fun invoke(context: RuleContext): Boolean { val path = context.getExt("fieldContext")?.path() ?: return false val name = context.rawType() ?: return false return pathPredict(path) && typePredict(name) diff --git a/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/rule/ScriptRuleParser.kt b/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/rule/ScriptRuleParser.kt index 2d669f714..e93f94b7d 100644 --- a/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/rule/ScriptRuleParser.kt +++ b/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/rule/ScriptRuleParser.kt @@ -31,7 +31,7 @@ import javax.script.ScriptContext import javax.script.ScriptEngine import javax.script.SimpleScriptContext -abstract class ScriptRuleParser : RuleParser { +abstract class ScriptRuleParser : AbstractRuleParser() { @Inject protected val duckTypeHelper: DuckTypeHelper? = null @@ -59,22 +59,28 @@ abstract class ScriptRuleParser : RuleParser { @Inject protected val logger: Logger? = null + override fun parseAnyRule(rule: String): AnyRule? { + return { context -> + eval(rule, context) + } + } override fun parseBooleanRule(rule: String): BooleanRule? { - return BooleanRule.of { context -> - return@of eval(rule, context).asBool() + return { context -> + eval(rule, context).asBool() } } override fun parseStringRule(rule: String): StringRule? { - return StringRule.of { context -> - return@of eval(rule, context)?.toPrettyString() + return { context -> + eval(rule, context)?.toPrettyString() } } override fun parseEventRule(rule: String): EventRule? { - return EventRule.of { + return { eval(rule, it) + Unit } } @@ -83,7 +89,15 @@ abstract class ScriptRuleParser : RuleParser { val simpleScriptContext = SimpleScriptContext() context.exts()?.forEach { - simpleScriptContext.setAttribute(it.key, it.value, ScriptContext.ENGINE_SCOPE) + simpleScriptContext.setAttribute( + it.key, + wrap( + obj = it.value, + context = context.getPsiContext(), + shouldCopy = false + ), + ScriptContext.ENGINE_SCOPE + ) } val contextForScript: RuleContext? = @@ -128,6 +142,54 @@ abstract class ScriptRuleParser : RuleParser { } } + private fun wrap(obj: Any?, context: PsiElement?, shouldCopy: Boolean = true): Any? { + if (obj == null) { + return null + } + + if (obj is RuleContext) { + return obj + } + + val className = obj::class.qualifiedName ?: return obj + if (className.startsWith("com.intellij") || className.startsWith("com.itangcent.intellij.jvm")) { + return try { + contextOf(obj, context) + } catch (e: IllegalArgumentException) { + obj + } + } + + if (shouldCopy) { + when (obj) { + is Map<*, *> -> { + val copy = LinkedHashMap() + for ((k, v) in obj.entries) { + copy[k] = wrap(v, context) + } + return copy + } + + is Collection<*> -> { + val copy = LinkedList() + for (ele in obj) { + copy.add(wrap(ele, context)) + } + return copy + } + + is Array<*> -> { + val copy = LinkedList() + for (ele in obj) { + copy.add(wrap(ele, context)) + } + return copy + } + } + } + return obj + } + /** * support usages: * @@ -149,48 +211,9 @@ abstract class ScriptRuleParser : RuleParser { @Suppress("UNCHECKED_CAST") private fun wrapAs(obj: Any?): T? { - return wrap(obj) as T? + return wrap(obj, getPsiContext()) as T? } - private fun wrap(obj: Any?): Any? { - if (obj == null) { - return null - } - - if (obj is RuleContext) { - return obj - } - - val className = obj::class.qualifiedName ?: return obj - if (className.startsWith("com.intellij") || className.startsWith("com.itangcent")) { - return contextOf(obj, getPsiContext()) - } - - if (obj is Map<*, *>) { - val copy = LinkedHashMap() - for ((k, v) in obj.entries) { - copy[k] = wrap(v) - } - return copy - } - - if (obj is Collection<*>) { - val copy = LinkedList() - for (ele in obj) { - copy.add(wrap(ele)) - } - return copy - } - - if (obj is Array<*>) { - val copy = LinkedList() - for (ele in obj) { - copy.add(wrap(ele)) - } - return copy - } - return obj - } fun name(): String { return getName() ?: "" @@ -568,7 +591,7 @@ abstract class ScriptRuleParser : RuleParser { /** * attention:it should not be used in [json.rule.field.name] */ - fun jsonName(): String? { + fun jsonName(): String { return psiClassHelper!!.getJsonFieldName(psiField) } @@ -802,7 +825,7 @@ abstract class ScriptRuleParser : RuleParser { } @ScriptIgnore - override fun getCore(): Any? { + override fun getCore(): Any { return explicitMethod } } diff --git a/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/rule/SuvRuleParser.kt b/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/rule/SuvRuleParser.kt index c0b73677b..f01910f12 100644 --- a/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/rule/SuvRuleParser.kt +++ b/idea-plugin/src/main/kotlin/com/itangcent/idea/plugin/rule/SuvRuleParser.kt @@ -1,7 +1,10 @@ package com.itangcent.idea.plugin.rule import com.google.inject.Inject -import com.itangcent.intellij.config.rule.* +import com.itangcent.intellij.config.rule.Rule +import com.itangcent.intellij.config.rule.RuleContext +import com.itangcent.intellij.config.rule.RuleParser +import com.itangcent.intellij.config.rule.SimpleRuleParser import com.itangcent.intellij.context.ActionContext import kotlin.reflect.KClass @@ -22,56 +25,28 @@ class SuvRuleParser : RuleParser { return getRuleParser(SimpleRuleParser::class).contextOf(target, context) } - override fun parseBooleanRule(rule: String): BooleanRule? { + override fun parseRule(rule: String, targetType: KClass<*>): Rule? { return when { rule.isBlank() -> null - rule.startsWith(JS_PREFIX) -> getRuleParser(JsRuleParser::class).parseBooleanRule( + rule.startsWith(JS_PREFIX) -> getRuleParser(JsRuleParser::class).parseRule( rule.removePrefix( JS_PREFIX - ) + ), targetType ) - rule.startsWith(GROOVY_PREFIX) -> getRuleParser(GroovyRuleParser::class).parseBooleanRule( + rule.startsWith(GROOVY_PREFIX) -> getRuleParser(GroovyRuleParser::class).parseRule( rule.removePrefix( GROOVY_PREFIX - ) + ), targetType ) - rule.startsWith(FIELD_PREFIX) -> getRuleParser(FieldPatternRuleParser::class).parseBooleanRule( + rule.startsWith(FIELD_PREFIX) -> getRuleParser(FieldPatternRuleParser::class).parseRule( rule.removePrefix( FIELD_PREFIX - ) + ), targetType ) - else -> getRuleParser(SimpleRuleParser::class).parseBooleanRule(rule) - } - } - - override fun parseStringRule(rule: String): StringRule? { - return when { - rule.isBlank() -> null - rule.startsWith(JS_PREFIX) -> getRuleParser(JsRuleParser::class).parseStringRule(rule.removePrefix(JS_PREFIX)) - rule.startsWith(GROOVY_PREFIX) -> getRuleParser(GroovyRuleParser::class).parseStringRule( - rule.removePrefix( - GROOVY_PREFIX - ) - ) - - else -> getRuleParser(SimpleRuleParser::class).parseStringRule(rule) - } - } - - override fun parseEventRule(rule: String): EventRule? { - return when { - rule.isBlank() -> null - rule.startsWith(JS_PREFIX) -> getRuleParser(JsRuleParser::class).parseEventRule(rule.removePrefix(JS_PREFIX)) - rule.startsWith(GROOVY_PREFIX) -> getRuleParser(GroovyRuleParser::class).parseEventRule( - rule.removePrefix( - GROOVY_PREFIX - ) - ) - - else -> getRuleParser(SimpleRuleParser::class).parseEventRule(rule) + else -> getRuleParser(SimpleRuleParser::class).parseRule(rule, targetType) } } 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 38bc27f64..98a0c229b 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 @@ -4,26 +4,26 @@ import com.google.inject.Inject import com.intellij.psi.PsiClass import com.intellij.psi.PsiElement import com.itangcent.common.constant.Attrs +import com.itangcent.common.logger.traceError import com.itangcent.common.utils.asBool import com.itangcent.common.utils.sub import com.itangcent.idea.plugin.api.export.AdditionalField import com.itangcent.idea.plugin.api.export.core.AdditionalParseHelper import com.itangcent.idea.plugin.api.export.core.ClassExportRuleKeys import com.itangcent.idea.plugin.api.export.yapi.YapiClassExportRuleKeys +import com.itangcent.idea.plugin.rule.SuvRuleContext 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.lookUp 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.SingleDuckType import com.itangcent.intellij.jvm.element.ExplicitClass -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 com.itangcent.intellij.psi.* import java.util.* /** @@ -32,6 +32,7 @@ import java.util.* * support rules: * 1. field.parse.before * 2. field.parse.after + * 3. field.order.with */ open class ContextualPsiClassHelper : DefaultPsiClassHelper() { @@ -123,16 +124,16 @@ open class ContextualPsiClassHelper : DefaultPsiClassHelper() { } override fun beforeParseField( - accessField: AccessibleField, + accessibleField: AccessibleField, resourcePsiClass: ExplicitClass, resolveContext: ResolveContext, fields: MutableMap, ): Boolean { - pushField(accessField.jsonFieldName()) - ruleComputer.computer(ClassExportRuleKeys.JSON_FIELD_PARSE_BEFORE, accessField) + pushField(accessibleField.jsonFieldName()) + ruleComputer.computer(ClassExportRuleKeys.JSON_FIELD_PARSE_BEFORE, accessibleField) return super.beforeParseField( - accessField, + accessibleField, resourcePsiClass, resolveContext, fields @@ -161,6 +162,26 @@ open class ContextualPsiClassHelper : DefaultPsiClassHelper() { popField(accessibleField.jsonFieldName()) } + override fun collectFields(explicitClass: ExplicitClass, option: Int): Collection { + var fields = super.collectFields(explicitClass, option) + if (ruleLookUp.lookUp(ClassExportRuleKeys.FIELD_ORDER_WITH).isNotEmpty()) { + try { + fields = fields.asSequence().withIndex().sortedWith { (index1, field1), (index2, field2) -> + ruleComputer.computer( + ClassExportRuleKeys.FIELD_ORDER_WITH, SuvRuleContext() + .apply { + setExt("a", field1.explicitElement) + setExt("b", field2.explicitElement) + }, null + ) ?: (index1.compareTo(index2)) + }.map { it.value }.toList() + } catch (e: Exception) { + logger.traceError("Failed to sort fields. Please check the rule of ${ClassRuleKeys.FIELD_ORDER}", e) + } + } + return fields + } + override fun afterParseField( accessibleField: AccessibleField, resourcePsiClass: ExplicitClass, @@ -273,13 +294,15 @@ open class ContextualPsiClassHelper : DefaultPsiClassHelper() { ClassRuleKeys.FIELD_NAME_PREFIX, ClassRuleKeys.FIELD_NAME_SUFFIX, ClassRuleKeys.JSON_UNWRAPPED, + ClassRuleKeys.FIELD_ORDER, YapiClassExportRuleKeys.FIELD_MOCK, YapiClassExportRuleKeys.FIELD_ADVANCED, ClassExportRuleKeys.FIELD_DEMO, ClassExportRuleKeys.FIELD_DEFAULT_VALUE, ClassExportRuleKeys.JSON_FIELD_PARSE_BEFORE, ClassExportRuleKeys.JSON_FIELD_PARSE_AFTER, - ClassExportRuleKeys.FIELD_REQUIRED + ClassExportRuleKeys.FIELD_REQUIRED, + ClassExportRuleKeys.FIELD_ORDER_WITH ) } } diff --git a/idea-plugin/src/main/resources/.recommend.easy.api.config b/idea-plugin/src/main/resources/.recommend.easy.api.config index c75e7dbc0..78862d894 100644 --- a/idea-plugin/src/main/resources/.recommend.easy.api.config +++ b/idea-plugin/src/main/resources/.recommend.easy.api.config @@ -665,4 +665,34 @@ field.ignore=groovy:``` }.flatten() return !prefixList.intersect(ignored).isEmpty() ``` -###set resolveProperty = true \ No newline at end of file +###set resolveProperty = true + +#[field_order] +field.order=#order +#[field_order_child_first] +# child fields first +field.order.with=groovy:``` + def aDefineClass = a.defineClass() + def bDefineClass = b.defineClass() + if(aDefineClass==bDefineClass){ + return 0 + }else if(aDefineClass.isExtend(bDefineClass.name())){ + return -1 + }else{ + return 1 + } +``` + +#[field_order_parent_first] +# parent fields first +field.order.with=groovy:``` + def aDefineClass = a.defineClass() + def bDefineClass = b.defineClass() + if(aDefineClass==bDefineClass){ + return 0 + }else if(aDefineClass.isExtend(bDefineClass.name())){ + return 1 + }else{ + return -1 + } +``` \ No newline at end of file diff --git a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/api/export/UrlSelectorTest.kt b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/api/export/UrlSelectorTest.kt index 3cab829be..2a477a173 100644 --- a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/api/export/UrlSelectorTest.kt +++ b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/api/export/UrlSelectorTest.kt @@ -8,7 +8,6 @@ import com.itangcent.idea.plugin.api.export.core.ClassExportRuleKeys.PATH_MULTI import com.itangcent.idea.plugin.api.export.core.ResolveMultiPath import com.itangcent.intellij.config.rule.Rule import com.itangcent.intellij.config.rule.RuleLookUp -import com.itangcent.intellij.config.rule.StringRule import com.itangcent.intellij.context.ActionContext import com.itangcent.mock.BaseContextTest import com.itangcent.test.mock @@ -35,9 +34,9 @@ abstract class BaseUrlSelectorAllTest : BaseContextTest() { PATH_MULTI.name(), PATH_MULTI.mode().targetType() as KClass ) - ) doReturn listOf( - StringRule.of { mode().name } - ) as List> + ) doReturn listOf> { + mode().name + } } } 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 8d46dfd34..f8a14fa2b 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\\\"},\\\"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\":\"

\"}]", + "[{\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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.shouldBeFirst\",\"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.shouldBeLast\",\"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].shouldBeFirst\",\"value\":\"\",\"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[0].shouldBeLast\",\"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\\\"},\\\"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\":\"

\"}]", + "[{\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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.shouldBeFirst\",\"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.shouldBeLast\",\"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].shouldBeFirst\",\"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[0].shouldBeLast\",\"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\\\"},\\\"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\":\"

\"}]", + "[{\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\"},\\\"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\":\"

\"}]", + "[{\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\"},\\\"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\":\"

\"}]", + "[{\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\"},\\\"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\":\"

\"}]", + "[{\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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 \\\"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\":\"

\"}]", + "[{\"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 \\\"shouldBeFirst\\\": \\\"str\\\",\\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 \\\"shouldBeLast\\\": \\\"str\\\",\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"shouldBeFirst\\\": \\\"str\\\",\\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 \\\"shouldBeLast\\\": \\\"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.shouldBeFirst\",\"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.shouldBeLast\",\"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].shouldBeFirst\",\"value\":\"\",\"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[0].shouldBeLast\",\"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 \\\"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\":\"

\"}]", + "[{\"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 \\\"shouldBeFirst\\\": \\\"str\\\",\\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 \\\"shouldBeLast\\\": \\\"str\\\",\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"shouldBeFirst\\\": \\\"str\\\",\\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 \\\"shouldBeLast\\\": \\\"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.shouldBeFirst\",\"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.shouldBeLast\",\"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].shouldBeFirst\",\"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[0].shouldBeLast\",\"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 \\\"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\":\"

\"}]", + "[{\"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 \\\"shouldBeFirst\\\": \\\"str\\\",\\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 \\\"shouldBeLast\\\": \\\"str\\\",\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"shouldBeFirst\\\": \\\"str\\\",\\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 \\\"shouldBeLast\\\": \\\"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 \\\"shouldBeFirst\\\": \\\"str\\\",\\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 \\\"shouldBeLast\\\": \\\"str\\\",\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"shouldBeFirst\\\": \\\"str\\\",\\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 \\\"shouldBeLast\\\": \\\"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\\\"},\\\"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\":\"

\"}]", + "[{\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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.shouldBeFirst\",\"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.shouldBeLast\",\"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].shouldBeFirst\",\"value\":\"\",\"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[0].shouldBeLast\",\"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\\\"},\\\"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\":\"

\"}]", + "[{\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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.shouldBeFirst\",\"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.shouldBeLast\",\"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].shouldBeFirst\",\"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[0].shouldBeLast\",\"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\\\"},\\\"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\":\"

\"}]", + "[{\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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\\\":{\\\"shouldBeFirst\\\":{\\\"type\\\":\\\"string\\\",\\\"mock\\\":{\\\"mock\\\":\\\"str\\\"},\\\"description\\\":\\\"\\\"},\\\"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\\\":\\\"\\\"},\\\"shouldBeLast\\\":{\\\"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 \\\"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\":\"

\"}]", + "[{\"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 \\\"shouldBeFirst\\\": \\\"str\\\",\\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 \\\"shouldBeLast\\\": \\\"str\\\",\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"shouldBeFirst\\\": \\\"str\\\",\\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 \\\"shouldBeLast\\\": \\\"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.shouldBeFirst\",\"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.shouldBeLast\",\"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].shouldBeFirst\",\"value\":\"\",\"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[0].shouldBeLast\",\"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 \\\"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\":\"

\"}]", + "[{\"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 \\\"shouldBeFirst\\\": \\\"str\\\",\\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 \\\"shouldBeLast\\\": \\\"str\\\",\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"shouldBeFirst\\\": \\\"str\\\",\\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 \\\"shouldBeLast\\\": \\\"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.shouldBeFirst\",\"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.shouldBeLast\",\"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].shouldBeFirst\",\"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[0].shouldBeLast\",\"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 \\\"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\":\"

\"}]", + "[{\"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 \\\"shouldBeFirst\\\": \\\"str\\\",\\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 \\\"shouldBeLast\\\": \\\"str\\\",\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"shouldBeFirst\\\": \\\"str\\\",\\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 \\\"shouldBeLast\\\": \\\"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 \\\"shouldBeFirst\\\": \\\"str\\\",\\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 \\\"shouldBeLast\\\": \\\"str\\\",\\n \\\"s\\\": \\\"str\\\",\\n \\\"s2\\\": \\\"str\\\"\\n },\\n \\\"modelList\\\": [\\n {\\n \\\"shouldBeFirst\\\": \\\"str\\\",\\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 \\\"shouldBeLast\\\": \\\"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 a3ec7c664..ca49d79a6 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 @@ -27,7 +27,19 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { "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\"}" + "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\"}\n" + + "field.order=#order\n" + + "field.order.with=groovy:```\n" + + " def aDefineClass = a.defineClass()\n" + + " def bDefineClass = b.defineClass()\n" + + " if(aDefineClass==bDefineClass){\n" + + " return 0\n" + + " }else if(aDefineClass.isExtend(bDefineClass.name())){\n" + + " return 1\n" + + " }else{\n" + + " return -1\n" + + " }\n" + + "```" } override fun bind(builder: ActionContext.ActionContextBuilder) { @@ -79,7 +91,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson(psiClassHelper.getTypeObject(PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass)) ) @@ -169,7 +181,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass, @@ -178,7 +190,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreBySetter\":false,\"onlyGet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreBySetter\":\"\",\"onlyGet\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreBySetter\":false,\"onlyGet\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreBySetter\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass, @@ -187,7 +199,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"onlySet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"onlySet\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"onlySet\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"onlySet\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass, @@ -196,7 +208,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false},\"@comment\":{\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\"},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false,\"shouldBeLast\":false},\"@comment\":{\"shouldBeFirst\":\"\",\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\",\"shouldBeLast\":\"\"},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass, @@ -282,7 +294,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson(psiClassHelper.getTypeObject(SingleDuckType(modelPsiClass), modelPsiClass)) ) @@ -367,7 +379,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( SingleDuckType(modelPsiClass), modelPsiClass, @@ -376,7 +388,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreBySetter\":false,\"onlyGet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreBySetter\":\"\",\"onlyGet\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreBySetter\":false,\"onlyGet\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreBySetter\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( SingleDuckType(modelPsiClass), modelPsiClass, @@ -385,7 +397,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"onlySet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"onlySet\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"onlySet\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"onlySet\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( SingleDuckType(modelPsiClass), modelPsiClass, @@ -394,7 +406,7 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false},\"@comment\":{\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\"},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false,\"shouldBeLast\":false},\"@comment\":{\"shouldBeFirst\":\"\",\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\",\"shouldBeLast\":\"\"},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( SingleDuckType(modelPsiClass), modelPsiClass, @@ -442,19 +454,19 @@ internal class YapiPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { //testGetFields------------------------------------------------------------------------------------------------------------ assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson(psiClassHelper.getFields(modelPsiClass)) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson(psiClassHelper.getFields(modelPsiClass, modelPsiClass)) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false},\"@comment\":{\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\"},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false,\"shouldBeLast\":false},\"@comment\":{\"shouldBeFirst\":\"\",\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\",\"shouldBeLast\":\"\"},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson(psiClassHelper.getFields(modelPsiClass, JsonOption.ALL)) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false},\"@comment\":{\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\"},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false,\"shouldBeLast\":false},\"@comment\":{\"shouldBeFirst\":\"\",\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\",\"shouldBeLast\":\"\"},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson(psiClassHelper.getFields(modelPsiClass, modelPsiClass, JsonOption.ALL)) ) assertEquals( diff --git a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/api/export/yapi/YapiSpringClassExporterBaseTest.kt b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/api/export/yapi/YapiSpringClassExporterBaseTest.kt index 8000afd0e..abed5029f 100644 --- a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/api/export/yapi/YapiSpringClassExporterBaseTest.kt +++ b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/api/export/yapi/YapiSpringClassExporterBaseTest.kt @@ -3,7 +3,10 @@ package com.itangcent.idea.plugin.api.export.yapi import com.google.inject.Inject import com.intellij.psi.PsiClass import com.itangcent.idea.plugin.api.export.ExportChannel -import com.itangcent.idea.plugin.api.export.core.* +import com.itangcent.idea.plugin.api.export.core.AdditionalParseHelper +import com.itangcent.idea.plugin.api.export.core.ClassExporter +import com.itangcent.idea.plugin.api.export.core.CompositeRequestBuilderListener +import com.itangcent.idea.plugin.api.export.core.RequestBuilderListener import com.itangcent.idea.plugin.settings.SettingBinder import com.itangcent.idea.plugin.settings.Settings import com.itangcent.idea.utils.RuleComputeListenerRegistry @@ -82,6 +85,18 @@ internal abstract class YapiSpringClassExporterBaseTest : PluginContextLightCode item["desc"] = "[admin]"+item["desc"] } ``` + field.order=#order + field.order.with=groovy:``` + def aDefineClass = a.defineClass() + def bDefineClass = b.defineClass() + if(aDefineClass==bDefineClass){ + return 0 + }else if(aDefineClass.isExtend(bDefineClass.name())){ + return 1 + }else{ + return -1 + } + ``` """ } diff --git a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/FieldPatternRuleParserTest.kt b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/FieldPatternRuleParserTest.kt index 587daa2b0..077dfd738 100644 --- a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/FieldPatternRuleParserTest.kt +++ b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/FieldPatternRuleParserTest.kt @@ -2,6 +2,8 @@ package com.itangcent.idea.plugin.rule import com.itangcent.debug.LoggerCollector import com.itangcent.idea.utils.ParseScriptContext +import com.itangcent.intellij.config.rule.parseBooleanRule +import com.itangcent.intellij.config.rule.parseEventRule import com.itangcent.intellij.context.ActionContext import com.itangcent.intellij.extend.guice.with import com.itangcent.intellij.logger.Logger @@ -26,28 +28,28 @@ class FieldPatternRuleParserTest : RuleParserBaseTest() { run { val context = ruleParser.contextOf(modelPsiClass.fields[0], modelPsiClass.fields[0]) context.setExt("fieldContext", FakeParseScriptContext("str")) - assertEquals(true, ruleParser.parseBooleanRule("*")!!.compute(context)) - assertEquals(true, ruleParser.parseBooleanRule("str")!!.compute(context)) - assertEquals(true, ruleParser.parseBooleanRule("*.str")!!.compute(context)) - assertEquals(false, ruleParser.parseBooleanRule("none")!!.compute(context)) - assertEquals(false, ruleParser.parseBooleanRule("*.none")!!.compute(context)) - assertEquals(true, ruleParser.parseBooleanRule("*.str|string")!!.compute(context)) - assertEquals(false, ruleParser.parseBooleanRule("*.none|string")!!.compute(context)) - assertEquals(true, ruleParser.parseBooleanRule("*.str|*")!!.compute(context)) - assertEquals(false, ruleParser.parseBooleanRule("*.str|int")!!.compute(context)) + assertEquals(true, ruleParser.parseBooleanRule("*")!!(context)) + assertEquals(true, ruleParser.parseBooleanRule("str")!!(context)) + assertEquals(true, ruleParser.parseBooleanRule("*.str")!!(context)) + assertEquals(false, ruleParser.parseBooleanRule("none")!!(context)) + assertEquals(false, ruleParser.parseBooleanRule("*.none")!!(context)) + assertEquals(true, ruleParser.parseBooleanRule("*.str|string")!!(context)) + assertEquals(false, ruleParser.parseBooleanRule("*.none|string")!!(context)) + assertEquals(true, ruleParser.parseBooleanRule("*.str|*")!!(context)) + assertEquals(false, ruleParser.parseBooleanRule("*.str|int")!!(context)) } run { val context = ruleParser.contextOf(modelPsiClass.fields[1], modelPsiClass.fields[1]) context.setExt("fieldContext", FakeParseScriptContext("integer")) - assertEquals(true, ruleParser.parseBooleanRule("*")!!.compute(context)) - assertEquals(true, ruleParser.parseBooleanRule("integer")!!.compute(context)) - assertEquals(true, ruleParser.parseBooleanRule("*.integer")!!.compute(context)) - assertEquals(false, ruleParser.parseBooleanRule("none")!!.compute(context)) - assertEquals(false, ruleParser.parseBooleanRule("*.none")!!.compute(context)) - assertEquals(true, ruleParser.parseBooleanRule("*.integer|int")!!.compute(context)) - assertEquals(false, ruleParser.parseBooleanRule("*.none|int")!!.compute(context)) - assertEquals(true, ruleParser.parseBooleanRule("*.integer|*")!!.compute(context)) - assertEquals(false, ruleParser.parseBooleanRule("*.integer|string")!!.compute(context)) + assertEquals(true, ruleParser.parseBooleanRule("*")!!(context)) + assertEquals(true, ruleParser.parseBooleanRule("integer")!!(context)) + assertEquals(true, ruleParser.parseBooleanRule("*.integer")!!(context)) + assertEquals(false, ruleParser.parseBooleanRule("none")!!(context)) + assertEquals(false, ruleParser.parseBooleanRule("*.none")!!(context)) + assertEquals(true, ruleParser.parseBooleanRule("*.integer|int")!!(context)) + assertEquals(false, ruleParser.parseBooleanRule("*.none|int")!!(context)) + assertEquals(true, ruleParser.parseBooleanRule("*.integer|*")!!(context)) + assertEquals(false, ruleParser.parseBooleanRule("*.integer|string")!!(context)) } } diff --git a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/GroovyRuleParserTest.kt b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/GroovyRuleParserTest.kt index b8055e176..7e9e2fd99 100644 --- a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/GroovyRuleParserTest.kt +++ b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/GroovyRuleParserTest.kt @@ -1,8 +1,7 @@ package com.itangcent.idea.plugin.rule import com.itangcent.debug.LoggerCollector -import com.itangcent.intellij.config.rule.BooleanRule -import com.itangcent.intellij.config.rule.StringRule +import com.itangcent.intellij.config.rule.* import com.itangcent.intellij.context.ActionContext import com.itangcent.intellij.extend.guice.with import com.itangcent.intellij.logger.Logger @@ -33,58 +32,58 @@ internal class GroovyRuleParserTest : RuleParserBaseTest() { ruleParser.parseStringRule("groovy:it.ann(\"org.springframework.web.bind.annotation.RequestMapping\")")!! assertEquals( "/greeting", - ruleReadRequestMapping.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod)) + ruleReadRequestMapping(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod)) ) assertEquals( null, - ruleReadRequestMapping.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleReadRequestMapping(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) val ruleReadGetMapping: StringRule = ruleParser.parseStringRule("groovy:it.ann(\"org.springframework.web.bind.annotation.GetMapping\")")!! - assertEquals(null, ruleReadGetMapping.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(null, ruleReadGetMapping(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( "/get/{id}", - ruleReadGetMapping.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleReadGetMapping(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) val ruleReadTagFolder: StringRule = ruleParser.parseStringRule("groovy:it.doc(\"folder\")")!! - assertEquals(null, ruleReadTagFolder.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(null, ruleReadTagFolder(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( "update-apis", - ruleReadTagFolder.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleReadTagFolder(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) } fun testParseBooleanRule() { val ruleCheckPublic: BooleanRule = ruleParser.parseBooleanRule("groovy:it.hasAnn(\"org.springframework.web.bind.annotation.RequestMapping\")")!! - assertEquals(true, ruleCheckPublic.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) - assertEquals(false, ruleCheckPublic.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod))) + assertEquals(true, ruleCheckPublic(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(false, ruleCheckPublic(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod))) val ruleCheckNotPublic: BooleanRule = ruleParser.parseBooleanRule("groovy:!it.hasAnn(\"org.springframework.web.bind.annotation.RequestMapping\")")!! - assertEquals(false, ruleCheckNotPublic.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) - assertEquals(true, ruleCheckNotPublic.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod))) + assertEquals(false, ruleCheckNotPublic(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(true, ruleCheckNotPublic(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod))) val ruleCheckDeprecated: BooleanRule = ruleParser.parseBooleanRule("groovy:it.hasAnn(\"java.lang.Deprecated\")")!! - assertEquals(false, ruleCheckDeprecated.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(false, ruleCheckDeprecated(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( true, - ruleCheckDeprecated.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleCheckDeprecated(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) val ruleCheckUndone: BooleanRule = ruleParser.parseBooleanRule("groovy:it.hasDoc(\"undone\")")!! - assertEquals(false, ruleCheckUndone.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(false, ruleCheckUndone(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( true, - ruleCheckUndone.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleCheckUndone(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) val ruleCheckDone: BooleanRule = ruleParser.parseBooleanRule("groovy:!it.hasDoc(\"undone\")")!! - assertEquals(true, ruleCheckDone.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(true, ruleCheckDone(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( false, - ruleCheckDone.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleCheckDone(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) for (script in arrayOf( @@ -92,17 +91,17 @@ internal class GroovyRuleParserTest : RuleParserBaseTest() { "groovy:it.isCollection()" )) { val ruleCheckIsCollection = ruleParser.parseBooleanRule(script)!! - assertEquals(false, ruleCheckIsCollection.compute(ruleParser.contextOf(modelPsiClass, modelPsiClass))) + assertEquals(false, ruleCheckIsCollection(ruleParser.contextOf(modelPsiClass, modelPsiClass))) assertEquals( true, - ruleCheckIsCollection.compute(ruleParser.contextOf(listPsiClass, listPsiClass)) + ruleCheckIsCollection(ruleParser.contextOf(listPsiClass, listPsiClass)) ) } } fun testParseEventRule() { LoggerCollector.getLog() - ruleParser.parseEventRule("groovy:logger.info(\"hello world\")")!!.compute(ruleParser.contextOf(listPsiClass, listPsiClass)) + ruleParser.parseEventRule("groovy:logger.info(\"hello world\")")!!(ruleParser.contextOf(listPsiClass, listPsiClass)) assertEquals("[INFO]\thello world\n", LoggerCollector.getLog().toUnixString()) } } \ No newline at end of file diff --git a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/JsRuleParserTest.kt b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/JsRuleParserTest.kt index b70b1b2a8..53e3f8600 100644 --- a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/JsRuleParserTest.kt +++ b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/JsRuleParserTest.kt @@ -1,8 +1,7 @@ package com.itangcent.idea.plugin.rule import com.itangcent.debug.LoggerCollector -import com.itangcent.intellij.config.rule.BooleanRule -import com.itangcent.intellij.config.rule.StringRule +import com.itangcent.intellij.config.rule.* import com.itangcent.intellij.context.ActionContext import com.itangcent.intellij.extend.guice.with import com.itangcent.intellij.logger.Logger @@ -39,60 +38,60 @@ internal class JsRuleParserTest : RuleParserBaseTest() { ruleParser.parseStringRule("js:it.ann(\"org.springframework.web.bind.annotation.RequestMapping\")")!! assertEquals( "/greeting", - ruleReadRequestMapping.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod)) + ruleReadRequestMapping(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod)) ) assertEquals( null, - ruleReadRequestMapping.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleReadRequestMapping(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) val ruleReadGetMapping: StringRule = ruleParser.parseStringRule("js:it.ann(\"org.springframework.web.bind.annotation.GetMapping\")")!! - assertEquals(null, ruleReadGetMapping.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(null, ruleReadGetMapping(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( "/get/{id}", - ruleReadGetMapping.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleReadGetMapping(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) val ruleReadTagFolder: StringRule = ruleParser.parseStringRule("js:it.doc(\"folder\")")!! - assertEquals(null, ruleReadTagFolder.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(null, ruleReadTagFolder(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( "update-apis", - ruleReadTagFolder.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleReadTagFolder(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) } fun testParseBooleanRule() { val ruleCheckPublic: BooleanRule = ruleParser.parseBooleanRule("js:it.hasAnn(\"org.springframework.web.bind.annotation.RequestMapping\")")!! - assertEquals(true, ruleCheckPublic.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) - assertEquals(false, ruleCheckPublic.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod))) + assertEquals(true, ruleCheckPublic(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(false, ruleCheckPublic(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod))) val ruleCheckNotPublic: BooleanRule = ruleParser.parseBooleanRule("js:!it.hasAnn(\"org.springframework.web.bind.annotation.RequestMapping\")")!! - assertEquals(false, ruleCheckNotPublic.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) - assertEquals(true, ruleCheckNotPublic.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod))) + assertEquals(false, ruleCheckNotPublic(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(true, ruleCheckNotPublic(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod))) val ruleCheckDeprecated: BooleanRule = ruleParser.parseBooleanRule("js:it.hasAnn(\"java.lang.Deprecated\")")!! - assertEquals(false, ruleCheckDeprecated.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(false, ruleCheckDeprecated(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( true, - ruleCheckDeprecated.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleCheckDeprecated(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) val ruleCheckUndone: BooleanRule = ruleParser.parseBooleanRule("js:it.hasDoc(\"undone\")")!! - assertEquals(false, ruleCheckUndone.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(false, ruleCheckUndone(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( true, - ruleCheckUndone.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleCheckUndone(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) val ruleCheckDone: BooleanRule = ruleParser.parseBooleanRule("js:!it.hasDoc(\"undone\")")!! - assertEquals(true, ruleCheckDone.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(true, ruleCheckDone(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( false, - ruleCheckDone.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleCheckDone(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) for (script in arrayOf( @@ -100,17 +99,16 @@ internal class JsRuleParserTest : RuleParserBaseTest() { "js:it.isCollection()" )) { val ruleCheckIsCollection = ruleParser.parseBooleanRule(script)!! - assertEquals(false, ruleCheckIsCollection.compute(ruleParser.contextOf(modelPsiClass, modelPsiClass))) + assertEquals(false, ruleCheckIsCollection(ruleParser.contextOf(modelPsiClass, modelPsiClass))) assertEquals( true, - ruleCheckIsCollection.compute(ruleParser.contextOf(listPsiClass, listPsiClass)) + ruleCheckIsCollection(ruleParser.contextOf(listPsiClass, listPsiClass)) ) } } fun testParseEventRule() { - ruleParser.parseEventRule("js:logger.info(\"hello world\")")!! - .compute(ruleParser.contextOf(listPsiClass, listPsiClass)) + ruleParser.parseEventRule("logger.info(\"hello world\")")!!(ruleParser.contextOf(listPsiClass, listPsiClass)) assertEquals("[INFO]\thello world\n", LoggerCollector.getLog().toUnixString()) } } \ No newline at end of file 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 f909ee022..f6ca32999 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 @@ -78,7 +78,19 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture "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\"}" + "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\"}\n" + + "field.order=#order\n" + + "field.order.with=groovy:```\n" + + " def aDefineClass = a.defineClass()\n" + + " def bDefineClass = b.defineClass()\n" + + " if(aDefineClass==bDefineClass){\n" + + " return 0\n" + + " }else if(aDefineClass.isExtend(bDefineClass.name())){\n" + + " return 1\n" + + " }else{\n" + + " return -1\n" + + " }\n" + + "```" } open fun PsiClass.asClassContext(): ScriptClassContext { @@ -236,6 +248,17 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " */\n" + " private Integer[] integerArray;\n" + "\n" + + " /**\n" + + " * @order 100\n" + + " */\n" + + " private String shouldBeLast;\n" + + "\n" + + " /**\n" + + " * @order 0\n" + + " */\n" + + " private String shouldBeFirst;\n" + + "\n" + + "\n" + " @JsonIgnore\n" + " private String shouldIgnore;\n" + "\n" + @@ -494,7 +517,7 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture fun testFieldCnt() { assertEquals(0, objectPsiClass.asClassContext().fieldCnt()) - assertEquals(7, modelPsiClass.asClassContext().fieldCnt()) + assertEquals(9, modelPsiClass.asClassContext().fieldCnt()) assertEquals(3, resultPsiClass.asClassContext().fieldCnt()) assertEquals(0, iResultPsiClass.asClassContext().fieldCnt()) } @@ -511,6 +534,7 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture assertEquals( "{\n" + + " \"shouldBeFirst\": \"\",\n" + " \"s\": \"\",\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + @@ -520,11 +544,13 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " 0\n" + " ],\n" + " \"onlySet\": \"\",\n" + - " \"onlyGet\": \"\"\n" + + " \"onlyGet\": \"\",\n" + + " \"shouldBeLast\": \"\"\n" + "}", modelPsiClass.asClassContext().toJson(true, true) ) assertEquals( "{\n" + + " \"shouldBeFirst\": \"\",\n" + " \"s\": \"\",\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + @@ -534,11 +560,13 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " 0\n" + " ],\n" + " \"shouldIgnoreBySetter\": \"\",\n" + - " \"onlyGet\": \"\"\n" + + " \"onlyGet\": \"\",\n" + + " \"shouldBeLast\": \"\"\n" + "}", modelPsiClass.asClassContext().toJson(true, false) ) assertEquals( "{\n" + + " \"shouldBeFirst\": \"\",\n" + " \"s\": \"\",\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + @@ -548,11 +576,13 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " 0\n" + " ],\n" + " \"shouldIgnoreByGetter\": \"\",\n" + - " \"onlySet\": \"\"\n" + + " \"onlySet\": \"\",\n" + + " \"shouldBeLast\": \"\"\n" + "}", modelPsiClass.asClassContext().toJson(false, true) ) assertEquals( "{\n" + + " \"shouldBeFirst\": \"\",\n" + " \"s\": \"\",\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + @@ -562,7 +592,8 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " 0\n" + " ],\n" + " \"shouldIgnoreByGetter\": \"\",\n" + - " \"shouldIgnoreBySetter\": \"\"\n" + + " \"shouldIgnoreBySetter\": \"\",\n" + + " \"shouldBeLast\": \"\"\n" + "}", modelPsiClass.asClassContext().toJson(false, false) ) @@ -666,6 +697,7 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture assertEquals( "{\n" + + " \"shouldBeFirst\": \"\",\n" + " \"s\": \"\", //string field\n" + " \"integer\": 0, //integer field\n" + " \"stringList\": [ //stringList field\n" + @@ -675,11 +707,13 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " 0\n" + " ],\n" + " \"onlySet\": \"\",\n" + - " \"onlyGet\": \"\"\n" + + " \"onlyGet\": \"\",\n" + + " \"shouldBeLast\": \"\"\n" + "}", modelPsiClass.asClassContext().toJson5(true, true) ) assertEquals( "{\n" + + " \"shouldBeFirst\": \"\",\n" + " \"s\": \"\", //string field\n" + " \"integer\": 0, //integer field\n" + " \"stringList\": [ //stringList field\n" + @@ -689,11 +723,13 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " 0\n" + " ],\n" + " \"shouldIgnoreBySetter\": \"\",\n" + - " \"onlyGet\": \"\"\n" + + " \"onlyGet\": \"\",\n" + + " \"shouldBeLast\": \"\"\n" + "}", modelPsiClass.asClassContext().toJson5(true, false) ) assertEquals( "{\n" + + " \"shouldBeFirst\": \"\",\n" + " \"s\": \"\", //string field\n" + " \"integer\": 0, //integer field\n" + " \"stringList\": [ //stringList field\n" + @@ -703,11 +739,13 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " 0\n" + " ],\n" + " \"shouldIgnoreByGetter\": \"\",\n" + - " \"onlySet\": \"\"\n" + + " \"onlySet\": \"\",\n" + + " \"shouldBeLast\": \"\"\n" + "}", modelPsiClass.asClassContext().toJson5(false, true) ) assertEquals( "{\n" + + " \"shouldBeFirst\": \"\",\n" + " \"s\": \"\", //string field\n" + " \"integer\": 0, //integer field\n" + " \"stringList\": [ //stringList field\n" + @@ -717,7 +755,8 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " 0\n" + " ],\n" + " \"shouldIgnoreByGetter\": \"\",\n" + - " \"shouldIgnoreBySetter\": \"\"\n" + + " \"shouldIgnoreBySetter\": \"\",\n" + + " \"shouldBeLast\": \"\"\n" + "}", modelPsiClass.asClassContext().toJson5(false, false) ) @@ -827,13 +866,16 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture assertEquals( "{\n" + - " \"s\": \"\",\n" + + " \"shouldBeFirst\": \"\",\n" + " \"@comment\": {\n" + + " \"shouldBeFirst\": \"\",\n" + " \"s\": \"string field\",\n" + " \"integer\": \"integer field\",\n" + " \"stringList\": \"stringList field\",\n" + - " \"integerArray\": \"integerArray field\"\n" + + " \"integerArray\": \"integerArray field\",\n" + + " \"shouldBeLast\": \"\"\n" + " },\n" + + " \"s\": \"\",\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + " \"\"\n" + @@ -842,7 +884,8 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " 0\n" + " ],\n" + " \"onlySet\": \"\",\n" + - " \"onlyGet\": \"\"\n" + + " \"onlyGet\": \"\",\n" + + " \"shouldBeLast\": \"\"\n" + "}", GsonUtils.prettyJson( modelPsiClass.asClassContext().toObject( @@ -854,14 +897,17 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture ) assertEquals( "{\n" + - " \"s\": \"\",\n" + + " \"shouldBeFirst\": \"\",\n" + " \"@comment\": {\n" + + " \"shouldBeFirst\": \"\",\n" + " \"s\": \"string field\",\n" + " \"integer\": \"integer field\",\n" + " \"stringList\": \"stringList field\",\n" + " \"integerArray\": \"integerArray field\",\n" + - " \"shouldIgnoreBySetter\": \"\"\n" + + " \"shouldIgnoreBySetter\": \"\",\n" + + " \"shouldBeLast\": \"\"\n" + " },\n" + + " \"s\": \"\",\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + " \"\"\n" + @@ -870,7 +916,8 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " 0\n" + " ],\n" + " \"shouldIgnoreBySetter\": \"\",\n" + - " \"onlyGet\": \"\"\n" + + " \"onlyGet\": \"\",\n" + + " \"shouldBeLast\": \"\"\n" + "}", GsonUtils.prettyJson( modelPsiClass.asClassContext().toObject( @@ -882,14 +929,17 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture ) assertEquals( "{\n" + - " \"s\": \"\",\n" + + " \"shouldBeFirst\": \"\",\n" + " \"@comment\": {\n" + + " \"shouldBeFirst\": \"\",\n" + " \"s\": \"string field\",\n" + " \"integer\": \"integer field\",\n" + " \"stringList\": \"stringList field\",\n" + " \"integerArray\": \"integerArray field\",\n" + - " \"shouldIgnoreByGetter\": \"\"\n" + + " \"shouldIgnoreByGetter\": \"\",\n" + + " \"shouldBeLast\": \"\"\n" + " },\n" + + " \"s\": \"\",\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + " \"\"\n" + @@ -898,7 +948,8 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " 0\n" + " ],\n" + " \"shouldIgnoreByGetter\": \"\",\n" + - " \"onlySet\": \"\"\n" + + " \"onlySet\": \"\",\n" + + " \"shouldBeLast\": \"\"\n" + "}", GsonUtils.prettyJson( modelPsiClass.asClassContext().toObject(false, true, true) @@ -906,15 +957,18 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture ) assertEquals( "{\n" + - " \"s\": \"\",\n" + + " \"shouldBeFirst\": \"\",\n" + " \"@comment\": {\n" + + " \"shouldBeFirst\": \"\",\n" + " \"s\": \"string field\",\n" + " \"integer\": \"integer field\",\n" + " \"stringList\": \"stringList field\",\n" + " \"integerArray\": \"integerArray field\",\n" + " \"shouldIgnoreByGetter\": \"\",\n" + - " \"shouldIgnoreBySetter\": \"\"\n" + + " \"shouldIgnoreBySetter\": \"\",\n" + + " \"shouldBeLast\": \"\"\n" + " },\n" + + " \"s\": \"\",\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + " \"\"\n" + @@ -923,7 +977,8 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " 0\n" + " ],\n" + " \"shouldIgnoreByGetter\": \"\",\n" + - " \"shouldIgnoreBySetter\": \"\"\n" + + " \"shouldIgnoreBySetter\": \"\",\n" + + " \"shouldBeLast\": \"\"\n" + "}", GsonUtils.prettyJson( modelPsiClass.asClassContext().toObject(false, false, true) @@ -932,6 +987,7 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture assertEquals( "{\n" + + " \"shouldBeFirst\": \"\",\n" + " \"s\": \"\",\n" + " \"integer\": 0,\n" + " \"stringList\": [\n" + @@ -941,7 +997,8 @@ abstract class ScriptClassContextBaseTest : PluginContextLightCodeInsightFixture " 0\n" + " ],\n" + " \"onlySet\": \"\",\n" + - " \"onlyGet\": \"\"\n" + + " \"onlyGet\": \"\",\n" + + " \"shouldBeLast\": \"\"\n" + "}", GsonUtils.prettyJson( modelPsiClass.asClassContext().toObject(true, true, false) diff --git a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/StandardJdkRuleParserTest.kt b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/StandardJdkRuleParserTest.kt index 330750f41..63afa1164 100644 --- a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/StandardJdkRuleParserTest.kt +++ b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/StandardJdkRuleParserTest.kt @@ -8,6 +8,8 @@ import com.itangcent.idea.plugin.utils.LocalStorage import com.itangcent.idea.plugin.utils.SessionStorage import com.itangcent.idea.utils.FileSaveHelper import com.itangcent.intellij.config.rule.RuleContext +import com.itangcent.intellij.config.rule.parseEventRule +import com.itangcent.intellij.config.rule.parseStringRule import com.itangcent.intellij.context.ActionContext import com.itangcent.intellij.extend.guice.with import com.itangcent.intellij.extend.withBoundary @@ -58,21 +60,21 @@ internal class StandardJdkRuleParserTest : RuleParserBaseTest() { fun testLogger() { arrayOf("logger", "LOG").forEach { logger -> LoggerCollector.getLog()//clear - ruleParser.parseEventRule("groovy:$logger.info(\"hello world\")")!!.compute(ruleContext) + ruleParser.parseEventRule("groovy:$logger.info(\"hello world\")")!!(ruleContext) assertEquals("[INFO]\thello world\n", LoggerCollector.getLog().toUnixString()) } } fun testLocalStorage() { - ruleParser.parseEventRule("groovy:localStorage.set(\"demo\",1)")!!.compute(ruleContext) + ruleParser.parseEventRule("groovy:localStorage.set(\"demo\",1)")!!(ruleContext) assertEquals(1, localStorage.get("demo")) } fun testSessionStorage() { arrayOf("session", "S").forEach { session -> - ruleParser.parseEventRule("groovy:$session.set(\"demo\",1)")!!.compute(ruleContext) + ruleParser.parseEventRule("groovy:$session.set(\"demo\",1)")!!(ruleContext) assertEquals(1, sessionStorage.get("demo")) - ruleParser.parseEventRule("groovy:$session.set(\"demo\",2)")!!.compute(ruleContext) + ruleParser.parseEventRule("groovy:$session.set(\"demo\",2)")!!(ruleContext) assertEquals(2, sessionStorage.get("demo")) } } @@ -80,8 +82,9 @@ internal class StandardJdkRuleParserTest : RuleParserBaseTest() { fun testHttpClient() { assertEquals( "200", - ruleParser.parseStringRule("groovy:httpClient.get(\"https://www.apache.org/licenses/LICENSE-1.1\").call().code()")!! - .compute(ruleContext) + ruleParser.parseStringRule("groovy:httpClient.get(\"https://www.apache.org/licenses/LICENSE-1.1\").call().code()")!!( + ruleContext + ) ) } @@ -93,17 +96,17 @@ internal class StandardJdkRuleParserTest : RuleParserBaseTest() { assertEquals( "com.itangcent.model.Model", ruleParser.parseStringRule("groovy:$helper.findClass(\"com.itangcent.model.Model\")")!! - .compute(ruleParser.contextOf(userCtrlPsiClass, userCtrlPsiClass)) + (ruleParser.contextOf(userCtrlPsiClass, userCtrlPsiClass)) ) assertEquals( "com.itangcent.model.Model#str", ruleParser.parseStringRule("groovy:$helper.resolveLink(\"{@link com.itangcent.model.Model#str}\")")!! - .compute(ruleParser.contextOf(userCtrlPsiClass, userCtrlPsiClass)) + (ruleParser.contextOf(userCtrlPsiClass, userCtrlPsiClass)) ) assertEquals( "[com.itangcent.model.Model, com.itangcent.model.Model#str]", ruleParser.parseStringRule("groovy:$helper.resolveLinks(\"{@link com.itangcent.model.Model},{@link com.itangcent.model.Model#str}\")")!! - .compute(ruleParser.contextOf(userCtrlPsiClass, userCtrlPsiClass)) + (ruleParser.contextOf(userCtrlPsiClass, userCtrlPsiClass)) ) } } @@ -116,36 +119,36 @@ internal class StandardJdkRuleParserTest : RuleParserBaseTest() { assertEquals( "123", ruleParser.parseStringRule("groovy:$config.get(\"x\")")!! - .compute(ruleContext) + (ruleContext) ) assertEquals( "123456", ruleParser.parseStringRule("groovy:$config.getValues(\"x\").join()")!! - .compute(ruleContext) + (ruleContext) ) assertEquals( "666", ruleParser.parseStringRule("groovy:$config.resolveProperty(\"\\\${y}\")")!! - .compute(ruleContext) + (ruleContext) ) assertNull( ruleParser.parseStringRule("groovy:$config.resolvePropertyWith(null,\"#\\\$\",[z:888])")!! - .compute(ruleContext) + (ruleContext) ) assertEquals( "#{x},888", ruleParser.parseStringRule("groovy:$config.resolvePropertyWith(\"#{x},\\\${z}\",null,[z:888])")!! - .compute(ruleContext) + (ruleContext) ) assertEquals( "123,", ruleParser.parseStringRule("groovy:$config.resolvePropertyWith(\"#{x},\\\${z}\",\"#\\\$\",null)")!! - .compute(ruleContext) + (ruleContext) ) assertEquals( "123,888", ruleParser.parseStringRule("groovy:$config.resolvePropertyWith(\"#{x},\\\${z}\",\"#\\\$\",[z:888])")!! - .compute(ruleContext) + (ruleContext) ) } } @@ -156,11 +159,9 @@ internal class StandardJdkRuleParserTest : RuleParserBaseTest() { fun testFiles() { arrayOf("files", "F").forEach { files -> val demoPath = tempDir.sub("demo.txt").escapeBackslash() - ruleParser.parseEventRule("groovy:$files.save(\"hello world\",\"$demoPath\")")!! - .compute(ruleContext) + ruleParser.parseEventRule("groovy:$files.save(\"hello world\",\"$demoPath\")")!!(ruleContext) assertEquals("hello world", FileUtils.read(File(demoPath))) - ruleParser.parseEventRule("groovy:$files.saveWithUI({\"hello world!\"},\"demo2.txt\",{},{},{})")!! - .compute(ruleContext) + ruleParser.parseEventRule("groovy:$files.saveWithUI({\"hello world!\"},\"demo2.txt\",{},{},{})")!!(ruleContext) assertEquals("hello world!", (fileSaveHelper as FileSaveHelperAdaptor).bytes()?.let { String(it, Charsets.UTF_8) }) } @@ -176,44 +177,44 @@ internal class StandardJdkRuleParserTest : RuleParserBaseTest() { assertEquals( "markdown", ruleParser.parseStringRule("groovy:$runtime.channel()")!! - .compute(ruleContext) + (ruleContext) ) assertEquals( project.name, ruleParser.parseStringRule("groovy:$runtime.projectName()")!! - .compute(ruleContext) + (ruleContext) ) assertEquals( project.basePath, ruleParser.parseStringRule("groovy:$runtime.projectPath()")!! - .compute(ruleContext) + (ruleContext) ) assertEquals( "test_default", ruleParser.parseStringRule("groovy:$runtime.module()")!! - .compute(ruleParser.contextOf("userCtrlPsiClass", userCtrlPsiClass)) + (ruleParser.contextOf("userCtrlPsiClass", userCtrlPsiClass)) ) assertEquals( "light_idea_test_case", ruleParser.parseStringRule("groovy:$runtime.moduleName()")!! - .compute(ruleParser.contextOf("userCtrlPsiClass", userCtrlPsiClass)) + (ruleParser.contextOf("userCtrlPsiClass", userCtrlPsiClass)) ) assertEquals( "/src", ruleParser.parseStringRule("groovy:$runtime.modulePath()")!! - .compute(ruleParser.contextOf("userCtrlPsiClass", userCtrlPsiClass)) + (ruleParser.contextOf("userCtrlPsiClass", userCtrlPsiClass)) ) assertEquals( "/src/api/UserCtrl.java", ruleParser.parseStringRule("groovy:$runtime.filePath()")!! - .compute(ruleParser.contextOf("userCtrlPsiClass", userCtrlPsiClass)) + (ruleParser.contextOf("userCtrlPsiClass", userCtrlPsiClass)) ) assertEquals( fileSaveHelper.toString(), ruleParser.parseStringRule("groovy:$runtime.getBean(\"com.itangcent.idea.utils.FileSaveHelper\")")!! - .compute(ruleParser.contextOf("userCtrlPsiClass", userCtrlPsiClass)) + (ruleParser.contextOf("userCtrlPsiClass", userCtrlPsiClass)) ) assertNull( ruleParser.parseStringRule("groovy:$runtime.getBean(\"java.lang.String\")")!! - .compute(ruleParser.contextOf("userCtrlPsiClass", userCtrlPsiClass)) + (ruleParser.contextOf("userCtrlPsiClass", userCtrlPsiClass)) ) assertNull( ruleParser.parseStringRule("groovy:$runtime.getBean(\"com.itangcent.Unknown\")")!! - .compute(ruleParser.contextOf("userCtrlPsiClass", userCtrlPsiClass)) + (ruleParser.contextOf("userCtrlPsiClass", userCtrlPsiClass)) ) actionContext.withBoundary { @@ -221,7 +222,7 @@ internal class StandardJdkRuleParserTest : RuleParserBaseTest() { "groovy:$runtime.async{" + "logger.info(\"log in async\")" + "}" - )!!.compute(ruleParser.contextOf("userCtrlPsiClass", userCtrlPsiClass)) + )!!(ruleParser.contextOf("userCtrlPsiClass", userCtrlPsiClass)) } assertLinesContain( diff --git a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/SuvRuleParserTest.kt b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/SuvRuleParserTest.kt index 031583b9d..b781f46d7 100644 --- a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/SuvRuleParserTest.kt +++ b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/rule/SuvRuleParserTest.kt @@ -1,8 +1,7 @@ package com.itangcent.idea.plugin.rule import com.itangcent.debug.LoggerCollector -import com.itangcent.intellij.config.rule.BooleanRule -import com.itangcent.intellij.config.rule.StringRule +import com.itangcent.intellij.config.rule.* import com.itangcent.intellij.context.ActionContext import com.itangcent.intellij.extend.guice.with import com.itangcent.intellij.logger.Logger @@ -37,11 +36,11 @@ internal class SuvRuleParserTest : RuleParserBaseTest() { ruleParser.parseStringRule(script)!! assertEquals( "/greeting", - ruleReadRequestMapping.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod)) + ruleReadRequestMapping(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod)) ) assertEquals( null, - ruleReadRequestMapping.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleReadRequestMapping(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) } @@ -51,10 +50,10 @@ internal class SuvRuleParserTest : RuleParserBaseTest() { "groovy:it.ann(\"org.springframework.web.bind.annotation.GetMapping\")" )) { val ruleReadGetMapping: StringRule = ruleParser.parseStringRule(script)!! - assertEquals(null, ruleReadGetMapping.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(null, ruleReadGetMapping(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( "/get/{id}", - ruleReadGetMapping.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleReadGetMapping(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) } @@ -64,10 +63,10 @@ internal class SuvRuleParserTest : RuleParserBaseTest() { "groovy:it.doc(\"folder\")" )) { val ruleReadTagFolder: StringRule = ruleParser.parseStringRule(script)!! - assertEquals(null, ruleReadTagFolder.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(null, ruleReadTagFolder(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( "update-apis", - ruleReadTagFolder.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleReadTagFolder(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) } @@ -83,10 +82,10 @@ internal class SuvRuleParserTest : RuleParserBaseTest() { "groovy:it.hasAnn(\"org.springframework.web.bind.annotation.RequestMapping\")" )) { val ruleCheckPublic: BooleanRule = ruleParser.parseBooleanRule(script)!! - assertEquals(true, ruleCheckPublic.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(true, ruleCheckPublic(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( false, - ruleCheckPublic.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleCheckPublic(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) } @@ -96,10 +95,10 @@ internal class SuvRuleParserTest : RuleParserBaseTest() { "groovy:!it.hasAnn(\"org.springframework.web.bind.annotation.RequestMapping\")" )) { val ruleCheckNotPublic: BooleanRule = ruleParser.parseBooleanRule(script)!! - assertEquals(false, ruleCheckNotPublic.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(false, ruleCheckNotPublic(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( true, - ruleCheckNotPublic.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleCheckNotPublic(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) } @@ -109,10 +108,10 @@ internal class SuvRuleParserTest : RuleParserBaseTest() { "groovy:it.hasAnn(\"java.lang.Deprecated\")" )) { val ruleCheckDeprecated: BooleanRule = ruleParser.parseBooleanRule(script)!! - assertEquals(false, ruleCheckDeprecated.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(false, ruleCheckDeprecated(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( true, - ruleCheckDeprecated.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleCheckDeprecated(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) } @@ -122,10 +121,10 @@ internal class SuvRuleParserTest : RuleParserBaseTest() { "groovy:it.hasDoc(\"undone\")" )) { val ruleCheckUndone: BooleanRule = ruleParser.parseBooleanRule(script)!! - assertEquals(false, ruleCheckUndone.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(false, ruleCheckUndone(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( true, - ruleCheckUndone.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleCheckUndone(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) } @@ -135,10 +134,10 @@ internal class SuvRuleParserTest : RuleParserBaseTest() { "groovy:!it.hasDoc(\"undone\")" )) { val ruleCheckDone: BooleanRule = ruleParser.parseBooleanRule(script)!! - assertEquals(true, ruleCheckDone.compute(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) + assertEquals(true, ruleCheckDone(ruleParser.contextOf(greetingPsiMethod, greetingPsiMethod))) assertEquals( false, - ruleCheckDone.compute(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) + ruleCheckDone(ruleParser.contextOf(getUserInfoPsiMethod, getUserInfoPsiMethod)) ) } @@ -150,10 +149,10 @@ internal class SuvRuleParserTest : RuleParserBaseTest() { "groovy:it.isCollection()" )) { val ruleCheckIsCollection = ruleParser.parseBooleanRule(script)!! - assertEquals(false, ruleCheckIsCollection.compute(ruleParser.contextOf(modelPsiClass, modelPsiClass))) + assertEquals(false, ruleCheckIsCollection(ruleParser.contextOf(modelPsiClass, modelPsiClass))) assertEquals( true, - ruleCheckIsCollection.compute(ruleParser.contextOf(listPsiClass, listPsiClass)) + ruleCheckIsCollection(ruleParser.contextOf(listPsiClass, listPsiClass)) ) } } @@ -168,8 +167,7 @@ internal class SuvRuleParserTest : RuleParserBaseTest() { "groovy:logger.info(\"hello world\")", "js:logger.info(\"hello world\")" )) { - ruleParser.parseEventRule(script)!! - .compute(ruleParser.contextOf(listPsiClass, listPsiClass)) + ruleParser.parseEventRule(script)!!(ruleParser.contextOf(listPsiClass, listPsiClass)) assertEquals("[INFO]\thello world\n", LoggerCollector.getLog().toUnixString()) } } diff --git a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/settings/helper/RecommendConfigLoaderTest.kt b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/settings/helper/RecommendConfigLoaderTest.kt index 00e528891..68ae9d6f9 100644 --- a/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/settings/helper/RecommendConfigLoaderTest.kt +++ b/idea-plugin/src/test/kotlin/com/itangcent/idea/plugin/settings/helper/RecommendConfigLoaderTest.kt @@ -80,7 +80,7 @@ internal class RecommendConfigLoaderTest { @Test fun testCodes() { assertEquals( - "[module, ignore, deprecated_java, deprecated_kotlin, not_ignore_irregular_api_method, Jackson, Jackson_JsonIgnoreProperties, Jackson_JsonUnwrapped, Gson, ignore_transient_field, converts, spring_Entity, spring_webflux, spring.validations, spring.ui, jakarta.validation, jakarta.validation(strict), javax.validation, javax.validation(strict), is_file, yapi_tag, yapi_tag_kotlin, yapi_status, yapi_mock, yapi_tag, import_spring_properties, resolve_spring_properties, ignore_serialVersionUID, support_mock_for_general, private_protected_field_only, support_mock_for_javax_validation, not_ignore_static_final_field, Jackson_JsonNaming, Jackson_UpperCamelCaseStrategy, Jackson_SnakeCaseStrategy, Jackson_LowerCaseStrategy, Jackson_KebabCaseStrategy, Jackson_LowerDotCaseStrategy, properties, Fastjson, enum_auto_select_field_by_type, enum_use_name, enum_use_ordinal, ignore_some_common_classes]", + "[module, ignore, deprecated_java, deprecated_kotlin, not_ignore_irregular_api_method, Jackson, Jackson_JsonIgnoreProperties, Jackson_JsonUnwrapped, Gson, ignore_transient_field, converts, spring_Entity, spring_webflux, spring.validations, spring.ui, jakarta.validation, jakarta.validation(strict), javax.validation, javax.validation(strict), is_file, yapi_tag, yapi_tag_kotlin, yapi_status, yapi_mock, yapi_tag, import_spring_properties, resolve_spring_properties, ignore_serialVersionUID, support_mock_for_general, private_protected_field_only, support_mock_for_javax_validation, not_ignore_static_final_field, Jackson_JsonNaming, Jackson_UpperCamelCaseStrategy, Jackson_SnakeCaseStrategy, Jackson_LowerCaseStrategy, Jackson_KebabCaseStrategy, Jackson_LowerDotCaseStrategy, properties, Fastjson, enum_auto_select_field_by_type, enum_use_name, enum_use_ordinal, ignore_some_common_classes, field_order, field_order_child_first, field_order_parent_first]", RecommendConfigLoader.codes().contentToString() ) 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 e0259ad3d..3c6a9a01c 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 @@ -1,18 +1,25 @@ package com.itangcent.idea.utils +import com.intellij.psi.PsiClass import com.intellij.psi.util.PsiTypesUtil import com.itangcent.common.utils.GsonUtils import com.itangcent.intellij.context.ActionContext import com.itangcent.intellij.extend.guice.with +import com.itangcent.intellij.jvm.JsonOption import com.itangcent.intellij.jvm.PsiClassHelper import com.itangcent.intellij.jvm.duck.SingleDuckType -import com.itangcent.intellij.jvm.JsonOption /** * Test case of [CustomizedPsiClassHelper] */ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() { + protected lateinit var subModelPsiClass: PsiClass + override fun beforeBind() { + super.beforeBind() + subModelPsiClass = loadClass("model/SubModel.java")!! + } + override fun customConfig(): String { //language=Properties return "dev=true\n" + @@ -25,7 +32,19 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() "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}\n" + "json.additional.field[com.itangcent.model.UserInfo#name]={\"name\":\"firstName\",\"defaultValue\":\"tang\",\"type\":\"java.lang.String\",\"desc\":\"a family name\",\"required\":false}\n" + - "json.additional.field[com.itangcent.model.UserInfo#age]={\"name\":\"order\",\"defaultValue\":\"12\",\"type\":\"int\",\"desc\":\"order of the age in family\",\"required\":true}" + "json.additional.field[com.itangcent.model.UserInfo#age]={\"name\":\"order\",\"defaultValue\":\"12\",\"type\":\"int\",\"desc\":\"order of the age in family\",\"required\":true}\n" + + "field.order=#order\n" + + "field.order.with=groovy:```\n" + + " def aDefineClass = a.defineClass()\n" + + " def bDefineClass = b.defineClass()\n" + + " if(aDefineClass==bDefineClass){\n" + + " return 0\n" + + " }else if(aDefineClass.isExtend(bDefineClass.name())){\n" + + " return 1\n" + + " }else{\n" + + " return -1\n" + + " }\n" + + "```" } override fun bind(builder: ActionContext.ActionContextBuilder) { @@ -76,7 +95,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson(psiClassHelper.getTypeObject(PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass)) ) @@ -91,11 +110,11 @@ 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,\"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\":\"\"}]}", + "{\"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\":{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false},\"s\":\"aaa\",\"integer\":0,\"stringList\":\"abc\",\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\",\"s2\":\"bbb\",\"@default\":{\"s\":\"aaa\",\"s2\":\"bbb\",\"stringList\":\"abc\"}},\"modelList\":[{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\"}]}", GsonUtils.toJson( psiClassHelper.getTypeObject( PsiTypesUtil.getClassType(defaultPsiClass), - userInfoPsiClass + defaultPsiClass ) ) ) @@ -176,7 +195,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass, @@ -185,7 +204,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreBySetter\":false,\"onlyGet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreBySetter\":\"\",\"onlyGet\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreBySetter\":false,\"onlyGet\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreBySetter\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass, @@ -194,7 +213,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"onlySet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"onlySet\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"onlySet\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"onlySet\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass, @@ -203,7 +222,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false},\"@comment\":{\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\"},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false,\"shouldBeLast\":false},\"@comment\":{\"shouldBeFirst\":\"\",\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\",\"shouldBeLast\":\"\"},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( PsiTypesUtil.getClassType(modelPsiClass), modelPsiClass, @@ -211,6 +230,42 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) ) + assertEquals( + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false,\"subShouldBeFirst\":false,\"subA\":false,\"subB\":false,\"subShouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"}", + GsonUtils.toJson( + psiClassHelper.getTypeObject( + PsiTypesUtil.getClassType(subModelPsiClass), subModelPsiClass, + JsonOption.NONE + ) + ) + ) + assertEquals( + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreBySetter\":false,\"onlyGet\":false,\"shouldBeLast\":false,\"subShouldBeFirst\":false,\"subA\":false,\"subB\":false,\"subShouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreBySetter\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"}", + GsonUtils.toJson( + psiClassHelper.getTypeObject( + PsiTypesUtil.getClassType(subModelPsiClass), subModelPsiClass, + JsonOption.READ_GETTER + ) + ) + ) + assertEquals( + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"onlySet\":false,\"shouldBeLast\":false,\"subShouldBeFirst\":false,\"subA\":false,\"subB\":false,\"subShouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"onlySet\":\"\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"}", + GsonUtils.toJson( + psiClassHelper.getTypeObject( + PsiTypesUtil.getClassType(subModelPsiClass), subModelPsiClass, + JsonOption.READ_SETTER + ) + ) + ) + assertEquals( + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false,\"shouldBeLast\":false,\"subShouldBeFirst\":false,\"subA\":false,\"subB\":false,\"subShouldBeLast\":false},\"@comment\":{\"shouldBeFirst\":\"\",\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"}", + GsonUtils.toJson( + psiClassHelper.getTypeObject( + PsiTypesUtil.getClassType(subModelPsiClass), subModelPsiClass, + JsonOption.ALL + ) + ) + ) assertEquals( "{\"id\":0,\"@required\":{\"id\":false,\"type\":false,\"name\":true,\"firstName\":false,\"age\":true,\"order\":true,\"sex\":false,\"birthDay\":false,\"regtime\":false,\"label\":true},\"@default\":{\"id\":\"0\",\"name\":\"tangcent\",\"firstName\":\"tang\",\"order\":\"12\",\"label\":\"genius\"},\"type\":0,\"name\":\"\",\"firstName\":\"\",\"age\":0,\"order\":0,\"sex\":0,\"birthDay\":\"\",\"regtime\":\"\",\"label\":\"\"}", GsonUtils.toJson( @@ -289,10 +344,15 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson(psiClassHelper.getTypeObject(SingleDuckType(modelPsiClass), modelPsiClass)) ) + assertEquals( + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false,\"subShouldBeFirst\":false,\"subA\":false,\"subB\":false,\"subShouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"}", + GsonUtils.toJson(psiClassHelper.getTypeObject(SingleDuckType(subModelPsiClass), subModelPsiClass)) + ) + assertEquals( "{\"id\":0,\"@required\":{\"id\":false,\"type\":false,\"name\":true,\"firstName\":false,\"age\":true,\"order\":true,\"sex\":false,\"birthDay\":false,\"regtime\":false,\"label\":true},\"@default\":{\"id\":\"0\",\"name\":\"tangcent\",\"firstName\":\"tang\",\"order\":\"12\",\"label\":\"genius\"},\"type\":0,\"name\":\"\",\"firstName\":\"\",\"age\":0,\"order\":0,\"sex\":0,\"birthDay\":\"\",\"regtime\":\"\",\"label\":\"\"}", GsonUtils.toJson(psiClassHelper.getTypeObject(SingleDuckType(userInfoPsiClass), userInfoPsiClass)) @@ -374,7 +434,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( SingleDuckType(modelPsiClass), modelPsiClass, @@ -383,7 +443,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreBySetter\":false,\"onlyGet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreBySetter\":\"\",\"onlyGet\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreBySetter\":false,\"onlyGet\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreBySetter\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( SingleDuckType(modelPsiClass), modelPsiClass, @@ -392,7 +452,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"onlySet\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"onlySet\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"onlySet\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"onlySet\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( SingleDuckType(modelPsiClass), modelPsiClass, @@ -401,7 +461,7 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false},\"@comment\":{\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\"},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false,\"shouldBeLast\":false},\"@comment\":{\"shouldBeFirst\":\"\",\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\",\"shouldBeLast\":\"\"},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson( psiClassHelper.getTypeObject( SingleDuckType(modelPsiClass), modelPsiClass, @@ -409,6 +469,42 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() ) ) ) + assertEquals( + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false,\"subShouldBeFirst\":false,\"subA\":false,\"subB\":false,\"subShouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"}", + GsonUtils.toJson( + psiClassHelper.getTypeObject( + SingleDuckType(subModelPsiClass), subModelPsiClass, + JsonOption.NONE + ) + ) + ) + assertEquals( + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreBySetter\":false,\"onlyGet\":false,\"shouldBeLast\":false,\"subShouldBeFirst\":false,\"subA\":false,\"subB\":false,\"subShouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreBySetter\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"}", + GsonUtils.toJson( + psiClassHelper.getTypeObject( + SingleDuckType(subModelPsiClass), subModelPsiClass, + JsonOption.READ_GETTER + ) + ) + ) + assertEquals( + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"onlySet\":false,\"shouldBeLast\":false,\"subShouldBeFirst\":false,\"subA\":false,\"subB\":false,\"subShouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"onlySet\":\"\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"}", + GsonUtils.toJson( + psiClassHelper.getTypeObject( + SingleDuckType(subModelPsiClass), subModelPsiClass, + JsonOption.READ_SETTER + ) + ) + ) + assertEquals( + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false,\"shouldBeLast\":false,\"subShouldBeFirst\":false,\"subA\":false,\"subB\":false,\"subShouldBeLast\":false},\"@comment\":{\"shouldBeFirst\":\"\",\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"}", + GsonUtils.toJson( + psiClassHelper.getTypeObject( + SingleDuckType(subModelPsiClass), subModelPsiClass, + JsonOption.ALL + ) + ) + ) assertEquals( "{\"id\":0,\"@required\":{\"id\":false,\"type\":false,\"name\":true,\"firstName\":false,\"age\":true,\"order\":true,\"sex\":false,\"birthDay\":false,\"regtime\":false,\"label\":true},\"@default\":{\"id\":\"0\",\"name\":\"tangcent\",\"firstName\":\"tang\",\"order\":\"12\",\"label\":\"genius\"},\"type\":0,\"name\":\"\",\"firstName\":\"\",\"age\":0,\"order\":0,\"sex\":0,\"birthDay\":\"\",\"regtime\":\"\",\"label\":\"\"}", GsonUtils.toJson( @@ -449,21 +545,37 @@ internal class CustomizedPsiClassHelperTest : ContextualPsiClassHelperBaseTest() fun testGetFields() { assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson(psiClassHelper.getFields(modelPsiClass)) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson(psiClassHelper.getFields(modelPsiClass, modelPsiClass)) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false},\"@comment\":{\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\"},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false,\"shouldBeLast\":false},\"@comment\":{\"shouldBeFirst\":\"\",\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\",\"shouldBeLast\":\"\"},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson(psiClassHelper.getFields(modelPsiClass, JsonOption.ALL)) ) assertEquals( - "{\"s\":\"\",\"@required\":{\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false},\"@comment\":{\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\"},\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\"}", + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false,\"shouldBeLast\":false},\"@comment\":{\"shouldBeFirst\":\"\",\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\",\"shouldBeLast\":\"\"},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\"}", GsonUtils.toJson(psiClassHelper.getFields(modelPsiClass, modelPsiClass, JsonOption.ALL)) ) + assertEquals( + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false,\"subShouldBeFirst\":false,\"subA\":false,\"subB\":false,\"subShouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"}", + GsonUtils.toJson(psiClassHelper.getFields(subModelPsiClass)) + ) + assertEquals( + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"shouldIgnoreByGetter\":false,\"shouldIgnoreBySetter\":false,\"shouldBeLast\":false,\"subShouldBeFirst\":false,\"subA\":false,\"subB\":false,\"subShouldBeLast\":false},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"shouldIgnoreByGetter\":\"\",\"shouldIgnoreBySetter\":\"\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"}", + GsonUtils.toJson(psiClassHelper.getFields(subModelPsiClass, subModelPsiClass)) + ) + assertEquals( + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false,\"shouldBeLast\":false,\"subShouldBeFirst\":false,\"subA\":false,\"subB\":false,\"subShouldBeLast\":false},\"@comment\":{\"shouldBeFirst\":\"\",\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"}", + GsonUtils.toJson(psiClassHelper.getFields(subModelPsiClass, JsonOption.ALL)) + ) + assertEquals( + "{\"shouldBeFirst\":\"\",\"@required\":{\"shouldBeFirst\":false,\"s\":false,\"integer\":false,\"stringList\":false,\"integerArray\":false,\"onlySet\":false,\"onlyGet\":false,\"shouldBeLast\":false,\"subShouldBeFirst\":false,\"subA\":false,\"subB\":false,\"subShouldBeLast\":false},\"@comment\":{\"shouldBeFirst\":\"\",\"s\":\"string field\",\"integer\":\"integer field\",\"stringList\":\"stringList field\",\"integerArray\":\"integerArray field\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"},\"s\":\"\",\"integer\":0,\"stringList\":[\"\"],\"integerArray\":[0],\"onlySet\":\"\",\"onlyGet\":\"\",\"shouldBeLast\":\"\",\"subShouldBeFirst\":\"\",\"subA\":\"\",\"subB\":\"\",\"subShouldBeLast\":\"\"}", + GsonUtils.toJson(psiClassHelper.getFields(subModelPsiClass, subModelPsiClass, JsonOption.ALL)) + ) assertEquals( "{\"id\":0,\"@required\":{\"id\":false,\"type\":false,\"name\":true,\"firstName\":false,\"age\":true,\"order\":true,\"sex\":false,\"birthDay\":false,\"regtime\":false,\"label\":true},\"@default\":{\"id\":\"0\",\"name\":\"tangcent\",\"firstName\":\"tang\",\"order\":\"12\",\"label\":\"genius\"},\"type\":0,\"name\":\"\",\"firstName\":\"\",\"age\":0,\"order\":0,\"sex\":0,\"birthDay\":\"\",\"regtime\":\"\",\"label\":\"\"}", GsonUtils.toJson(psiClassHelper.getFields(userInfoPsiClass)) diff --git a/idea-plugin/src/test/resources/model/Model.java b/idea-plugin/src/test/resources/model/Model.java index 5452f2799..f58430b33 100644 --- a/idea-plugin/src/test/resources/model/Model.java +++ b/idea-plugin/src/test/resources/model/Model.java @@ -28,6 +28,17 @@ class Model { */ private Integer[] integerArray; + /** + * @order 100 + */ + private String shouldBeLast; + + /** + * @order 0 + */ + private String shouldBeFirst; + + @JsonIgnore private String shouldIgnore; diff --git a/idea-plugin/src/test/resources/model/SubModel.java b/idea-plugin/src/test/resources/model/SubModel.java new file mode 100644 index 000000000..9c6610bf9 --- /dev/null +++ b/idea-plugin/src/test/resources/model/SubModel.java @@ -0,0 +1,20 @@ +package com.itangcent.model; + +import com.itangcent.model.Model; + +class SubModel extends Model { + + private String subA; + + /** + * @order 100 + */ + private String subShouldBeLast; + + private String subB; + + /** + * @order 0 + */ + private String subShouldBeFirst; +} \ No newline at end of file