有没有人能够在swaggger 2.0版的Model选项卡中定义可能的'enum'值?示例:http : //petstore.swagger.wordnik.com/#!/pet/addPet具有"status"属性的枚举选项,但该示例使用的是swagger 1.0版(根据JSON对象中定义的swagger版本).我试图在版本2.0中实现相同但没有运气,不确定文档是否正确.
有什么暗示吗?
我坚持这一点,我无法进步 - 我想解决方案很简单,但我无法弄清楚.我正在尝试在reducer中添加条目,因此in in中的数据看起来像这样:
state = {
entryId: {
entryName: ["something", "something2", "something3" /* and so on... */]
}
};
Run Code Online (Sandbox Code Playgroud)
到目前为止,这是我得到的最接近的,但是,它不是添加新的唯一条目,而是替换已经存储的条目.此外,我需要能够将此项添加到空状态,其中entryId,entryName尚不存在以避免错误:
switch(type) {
case ADD_ENTRY:
return {
...state,
[entryId]: {
...state[entryId],
[entryName]: {
[uniqueEntry]: true
}
}
};
}
Run Code Online (Sandbox Code Playgroud)
知道我做错了什么吗?
我需要根据比较结果创建一个返回true或false的函数.
我有两个字符串:
$one = 'sample product - White - Large'; // White is separate key, and large is separate too
$two = 'White Large';
Run Code Online (Sandbox Code Playgroud)
你知道做任务的快捷方法吗?爆炸两个字符串可能不安全,因为一些字符串而不是白色字符串将具有:蓝色 - 黑色 - 大.所以我正在寻找Blue - Black的存在.
我的数据的另一个例子是:
$one = 'sample product - White - Blue - Large'; // White - Blue is separate key, Large is separate too.
Run Code Online (Sandbox Code Playgroud)
如果有人对如何做有任何想法,我会非常感激.
谢谢,eloleon
ecmascript-6 ×1
ecmascript-7 ×1
javascript ×1
json ×1
php ×1
react-redux ×1
reactjs ×1
redux ×1
string ×1
swagger ×1