42 append(result, indent,
"properties:\n");
44 Iterator keys = json.keys();
45 while (keys.hasNext()) {
46 String nextKey = (String) keys.next();
47 append(result, indent, String.format(
"%s:\n", nextKey));
48 Object opt = json.opt(nextKey);
49 if (opt instanceof String) {
50 append(result, indent,
" type: string\n");
51 }
else if (opt instanceof JSONObject) {
54 }
else if (opt instanceof Integer || opt instanceof Long) {
55 append(result, indent,
" type: integer\n");
56 }
else if (opt instanceof Boolean) {
57 append(result, indent,
" type: boolean\n");
58 }
else if (opt instanceof Float || opt instanceof Double) {
59 append(result, indent,
" type: number\n");
60 }
else if (opt instanceof JSONArray) {
61 append(result, indent,
" type: array\n");
62 append(result, indent,
" items:\n");
63 append(result, indent,
" type: string\n");
64 }
else if (opt == null || opt == JSONObject.NULL) {
65 append(result, indent,
" type: string\n");
67 System.out.println(opt);
72 append(result, indent,
" example: ok\n");
75 append(result, indent,
" example: bcad760f-91ba-46e1-a020-05e4281d91b6\n");
77 case "client_id_of_oxd_id":
78 append(result, indent,
" example: ccad760f-91ba-46e1-a020-05e4281d91b6\n");
81 append(result, indent,
" example: https://<op-hostname>\n");
84 append(result, indent,
" example: '@!1736.179E.AA60.16B2!0001!8F7C.B9AB!0008!A2BB.9AE6.5F14.B387'\n");
87 append(result, indent,
" example: f436b936-03fc-433f-9772-53c2bc9e1c74\n");
89 case "client_registration_access_token":
90 append(result, indent,
" example: d836df94-44b0-445a-848a-d43189839b17\n");
92 case "client_registration_client_uri":
93 append(result, indent,
" example: https://<op-hostname>/oxauth/restv1/register?client_id=@!1736.179E.AA60.16B2!0001!8F7C.B9AB!0008!A2BB.9AE6.5F14.B387\n");
95 case "client_id_issued_at":
96 append(result, indent,
" example: 1501854943\n");
98 case "client_secret_expires_at":
99 append(result, indent,
" example: 1501941343\n");
102 append(result, indent,
" example: [\"openid\"]\n");
104 case "authorization_redirect_uri":
105 case "post_logout_redirect_uri":
106 append(result, indent,
" example: https://client.example.org/cb\n");
108 case "application_type":
109 append(result, indent,
" example: web\n");
111 case "response_types":
112 append(result, indent,
" example: [\"code\"]\n");
115 append(result, indent,
" example: [\"authorization_code\", \"client_credentials\"]\n");
118 append(result, indent,
" example: [\"basic\"]\n");
121 append(result, indent,
" example: [\"foo_bar@spam.org\"]\n");
124 append(result, indent,
" example: b75434ff-f465-4b70-92e4-b7ba6b6c58f2\n");
128 append(result, indent,
" example: 299\n");
131 append(result, indent,
" example: 1419350238\n");
134 append(result, indent,
" example: l238j323ds-23ij4\n");
137 append(result, indent,
" example: true\n");
140 append(result, indent,
" example: John Black\n");
143 append(result, indent,
" example: bearer\n");
146 append(result, indent,
" example: jblack\n");
149 append(result, indent,
" example: https://as.gluu.org/\n");
151 case "extension_field":
152 append(result, indent,
" example: twenty-seven\n");
155 append(result, indent,
" example: eyJraWQiOiI5MTUyNTU1Ni04YmIwLTQ2MzYtYTFhYy05ZGVlNjlhMDBmYWUiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRwczovL2NlLWRldjMuZ2x1dS5vcmciLCJhdWQiOiJAITE3MzYuMTc5RS5BQTYwLjE2QjIhMDAwMSE4RjdDLkI5QUIhMDAwOCE5Njk5LkFFQzcuOTM3MS4yODA3IiwiZXhwIjoxNTAxODYwMzMwLCJpYXQiOjE1MDE4NTY3MzAsIm5vbmNlIjoiOGFkbzJyMGMzYzdyZG03OHU1OTUzbTc5MXAiLCJhdXRoX3RpbWUiOjE1MDE4NTY2NzIsImF0X2hhc2giOiItQ3gyZHo1V3Z3X2tCWEFjVHMzbUZBIiwib3hPcGVuSURDb25uZWN0VmVyc2lvbiI6Im\n");
157 case "refresh_token":
158 append(result, indent,
" example: 33d7988e-6ffb-4fe5-8c2a-0e158691d446\n");
161 append(result, indent,
" example: -Cx2dz5Wvw_kBXAcTs3mFA\n");
static void append(StringBuilder result, int indent, String toAppend)
Definition: ManualSwaggerGenerator.java:27
static void handleJSONObject(StringBuilder result, JSONObject json, int indent)
Definition: ManualSwaggerGenerator.java:34