最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to convert this WSDL requirement to an OpenAPI schema definition - Stack Overflow

programmeradmin3浏览0评论

So I had this wsdl type

<xsd:element name="studentMarks" minOccurs="0"
                    maxOccurs="1">
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:decimal">
                            <xsd:totalDigits value="10" />
                            <xsd:fractionDigits value="5" />
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:element>

I want to convert this to an OpenAPI field with type: number.

This is what I have come up with, which is wrong.

I know that I can use string type to do this. But is there a way to do this with type number?

"studentMarks": {
           "type": "number",
           "format": "double",
           "multipleOf": 1e-5
          },

So I had this wsdl type

<xsd:element name="studentMarks" minOccurs="0"
                    maxOccurs="1">
                    <xsd:simpleType>
                        <xsd:restriction base="xsd:decimal">
                            <xsd:totalDigits value="10" />
                            <xsd:fractionDigits value="5" />
                        </xsd:restriction>
                    </xsd:simpleType>
                </xsd:element>

I want to convert this to an OpenAPI field with type: number.

This is what I have come up with, which is wrong.

I know that I can use string type to do this. But is there a way to do this with type number?

"studentMarks": {
           "type": "number",
           "format": "double",
           "multipleOf": 1e-5
          },
Share Improve this question edited Mar 25 at 14:15 Jeremy Fiel 3,3652 gold badges12 silver badges26 bronze badges asked Mar 25 at 12:41 noddermonnoddermon 111 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

You can set the multipleOf to 0.00001 and the exclusiveMaximum value to 1000000000

{
  "studentMarks": {
    "type": "number",
    "multipleOf": 0.00001,
    "exclusiveMaximum": 1000000000
}
发布评论

评论列表(0)

  1. 暂无评论