|
728 | 728 | "valid": true |
729 | 729 | } |
730 | 730 | ] |
| 731 | + }, |
| 732 | + { |
| 733 | + "description": "validation of Byte", |
| 734 | + "schema": {"format": "byte"}, |
| 735 | + "tests": [ |
| 736 | + { |
| 737 | + "description": "'hello world' encoded in base64", |
| 738 | + "data": "aGVsbG8gd29ybGQ=", |
| 739 | + "valid": true |
| 740 | + }, |
| 741 | + { |
| 742 | + "description": "multiline base64", |
| 743 | + "data": "VGhpcyBpcyBhIGJhc2U2NCBtdWx0aWxpbmUgc3RyaW5nIHRoYXQgc3BhbnMgbW9yZSB0aGFuIDc2\nIGNoYXJhY3RlcnMgdG8gdGVzdCBtdWx0aWxpbmUgY2FwYWJpbGl0aWVzCg==", |
| 744 | + "valid": true |
| 745 | + }, |
| 746 | + { |
| 747 | + "description": "Invalid base64", |
| 748 | + "data": "aGVsbG8gd29ybG=", |
| 749 | + "valid": false |
| 750 | + } |
| 751 | + ] |
| 752 | + }, |
| 753 | + { |
| 754 | + "description": "validation of int32", |
| 755 | + "schema": {"type": "number", "format": "int32"}, |
| 756 | + "tests": [ |
| 757 | + { |
| 758 | + "description": "256 is ok", |
| 759 | + "data": 256, |
| 760 | + "valid": true |
| 761 | + }, |
| 762 | + { |
| 763 | + "description": "256.1 fails", |
| 764 | + "data": 256.1, |
| 765 | + "valid": false |
| 766 | + }, |
| 767 | + { |
| 768 | + "description": "-(2**31) is ok", |
| 769 | + "data": -2147483648, |
| 770 | + "valid": true |
| 771 | + }, |
| 772 | + { |
| 773 | + "description": "-(2**31) - 1 fails", |
| 774 | + "data": -2147483649, |
| 775 | + "valid": false |
| 776 | + }, |
| 777 | + { |
| 778 | + "description": "(2**31)-1 is ok", |
| 779 | + "data": 2147483647, |
| 780 | + "valid": true |
| 781 | + }, |
| 782 | + { |
| 783 | + "description": "2**31 fails", |
| 784 | + "data": 2147483648, |
| 785 | + "valid": false |
| 786 | + }, |
| 787 | + { |
| 788 | + "description": "non-numeric fails", |
| 789 | + "data": "x", |
| 790 | + "valid": false |
| 791 | + } |
| 792 | + ] |
| 793 | + }, |
| 794 | + { |
| 795 | + "description": "validation of int64", |
| 796 | + "schema": {"type": "number", "format": "int64"}, |
| 797 | + "tests": [ |
| 798 | + { |
| 799 | + "description": "256 is ok", |
| 800 | + "data": 256, |
| 801 | + "valid": true |
| 802 | + }, |
| 803 | + { |
| 804 | + "description": "float fails", |
| 805 | + "data": 256.1, |
| 806 | + "valid": false |
| 807 | + }, |
| 808 | + { |
| 809 | + "description": "non-numeric fails", |
| 810 | + "data": "x", |
| 811 | + "valid": false |
| 812 | + } |
| 813 | + ] |
| 814 | + }, |
| 815 | + { |
| 816 | + "description": "validation of float", |
| 817 | + "schema": {"type": "number", "format": "float"}, |
| 818 | + "tests": [ |
| 819 | + { |
| 820 | + "description": "256.1 is ok", |
| 821 | + "data": 256.1, |
| 822 | + "valid": true |
| 823 | + }, |
| 824 | + { |
| 825 | + "description": "non-numeric fails", |
| 826 | + "data": "x", |
| 827 | + "valid": false |
| 828 | + } |
| 829 | + ] |
| 830 | + }, |
| 831 | + { |
| 832 | + "description": "validation of double", |
| 833 | + "schema": {"type": "number", "format": "double"}, |
| 834 | + "tests": [ |
| 835 | + { |
| 836 | + "description": "256.1 is ok", |
| 837 | + "data": 256.1, |
| 838 | + "valid": true |
| 839 | + }, |
| 840 | + { |
| 841 | + "description": "non-numeric fails", |
| 842 | + "data": "x", |
| 843 | + "valid": false |
| 844 | + } |
| 845 | + ] |
| 846 | + }, |
| 847 | + { |
| 848 | + "description": "validation of password", |
| 849 | + "schema": {"format": "password"}, |
| 850 | + "tests": [ |
| 851 | + { |
| 852 | + "description": "'password string' is ok", |
| 853 | + "data": "password string", |
| 854 | + "valid": true |
| 855 | + } |
| 856 | + ] |
| 857 | + }, |
| 858 | + { |
| 859 | + "description": "validation of binary", |
| 860 | + "schema": {"format": "binary"}, |
| 861 | + "tests": [ |
| 862 | + { |
| 863 | + "description": "'binary string' is ok", |
| 864 | + "data": "binary string", |
| 865 | + "valid": true |
| 866 | + } |
| 867 | + ] |
731 | 868 | } |
732 | 869 | ] |
0 commit comments