1

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
          },

1 Answer 1

0

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

{
  "studentMarks": {
    "type": "number",
    "multipleOf": 0.00001,
    "exclusiveMaximum": 1000000000
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.