我有一个打开的api yaml文件,如下所示。我想将空字符串值指定为字符串类型属性的默认值。该怎么做
Test:
type: object
required: ['', '']
properties:
test1:
type: string
default: " "
答案 0 :(得分:1)
可以肯定的是:
默认:“”
也就是说,其中没有空格。
答案 1 :(得分:0)
如果默认为“”,则 Swagger 字符串类型显示“字符串”。
default - The default value represents what would be assumed by the consumer of the input as the value of the schema if one is not provided. Unlike JSON Schema, the value MUST conform to the defined type for the Schema Object defined at the same level. For example, if type is string, then default can be "foo" but cannot be 1.
这里是问题主题:https://github.com/swagger-api/swagger-codegen/issues/43