- System.out.println("Warning: Schema directory is not set so using default schema dir: " + ALT_SCHEMA_DIR);
- schemaDir = ALT_SCHEMA_DIR;
- }
- else {
- System.out.println("Warning: Schema directory is not set so using default schema dir: " + DEFAULT_SCHEMA_DIR);
- schemaDir = DEFAULT_SCHEMA_DIR;
- }
+ System.out.println("Warning: Schema directory is not set so using default schema dir: " + ALT_SCHEMA_DIR);
+ schemaDir = ALT_SCHEMA_DIR;
+ }
+ else {
+ System.out.println("Warning: Schema directory is not set so using default schema dir: " + DEFAULT_SCHEMA_DIR);
+ schemaDir = DEFAULT_SCHEMA_DIR;
+ }
configuration.setClassForTemplateLoading(Api.class, "/");
String resourcePath = "src/main/resources";
if(System.getProperty("user.dir") != null && !System.getProperty("user.dir").contains(DEFAULT_RUN_DIR)) {
configuration.setClassForTemplateLoading(Api.class, "/");
String resourcePath = "src/main/resources";
if(System.getProperty("user.dir") != null && !System.getProperty("user.dir").contains(DEFAULT_RUN_DIR)) {
requestBody = requestBodyList.get(0);
for(String key : requestBody.keySet()) {
//Filter out all the relationship links that appear in the YAML
requestBody = requestBodyList.get(0);
for(String key : requestBody.keySet()) {
//Filter out all the relationship links that appear in the YAML
- if(key.equals("description")) {
- String reqBody=(String)requestBody.get(key);
- if(!reqBody.replaceAll("\\[.*.json\\)", "").equals(reqBody)) {
- requestBody.put(key, reqBody.replaceAll("\\[.*.json\\)", ""));
- }
- }
+ if(key.equals("description")) {
+ String reqBody=(String)requestBody.get(key);
+ if(!reqBody.replaceAll("\\[.*.json\\)", "").equals(reqBody)) {
+ requestBody.put(key, reqBody.replaceAll("\\[.*.json\\)", ""));
+ }
+ }
- if(key.equals("schema")) {
- LinkedHashMap<String,String> reqBody = (LinkedHashMap<String,String>)requestBody.get(key);
- String schema=reqBody.get("$ref");
- String schemaNopatch = schema.replace("patchDefinitions", "definitions");
-
- if(! schema.equals(schemaNopatch)) {
- reqBody.put("$ref", schemaNopatch);
- requestBody.put(key, reqBody);
- }
- }
+ if(key.equals("schema")) {
+ LinkedHashMap<String,String> reqBody = (LinkedHashMap<String,String>)requestBody.get(key);
+ String schema=reqBody.get("$ref");
+ String schemaNopatch = schema.replace("patchDefinitions", "definitions");
+
+ if(! schema.equals(schemaNopatch)) {
+ reqBody.put("$ref", schemaNopatch);
+ requestBody.put(key, reqBody);
+ }
+ }