[html2] Support alias types (#18579)

* [html2] Support alias models to render html docs.

* [html2] Fix compile error

* [html2] Update sample
This commit is contained in:
Aniokrait 2024-05-12 00:33:47 +09:00 committed by GitHub
parent 4637658f78
commit 3d96a404e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 293 additions and 202 deletions

View File

@ -442,7 +442,7 @@ public class DefaultGenerator implements Generator {
}
}
void generateModels(List<File> files, List<ModelMap> allModels, List<String> unusedModels) {
void generateModels(List<File> files, List<ModelMap> allModels, List<String> unusedModels, List<ModelMap> aliasModels) {
if (!generateModels) {
// TODO: Process these anyway and add to dryRun info
LOGGER.info("Skipping generation of models.");
@ -567,6 +567,8 @@ public class DefaultGenerator implements Generator {
CodegenModel m = modelTemplate.getModel();
if (m.isAlias) {
// alias to number, string, enum, etc, which should not be generated as model
// but aliases are still used to dereference models in some languages (such as in html2).
aliasModels.add(modelTemplate); // Store aliases in the separate list.
continue; // Don't create user-defined classes for aliases
}
}
@ -1074,11 +1076,11 @@ public class DefaultGenerator implements Generator {
generateVersionMetadata(files);
}
Map<String, Object> buildSupportFileBundle(List<OperationsMap> allOperations, List<ModelMap> allModels) {
return this.buildSupportFileBundle(allOperations, allModels, null);
Map<String, Object> buildSupportFileBundle(List<OperationsMap> allOperations, List<ModelMap> allModels, List<ModelMap> aliasModels) {
return this.buildSupportFileBundle(allOperations, allModels, aliasModels, null);
}
Map<String, Object> buildSupportFileBundle(List<OperationsMap> allOperations, List<ModelMap> allModels, List<WebhooksMap> allWebhooks) {
Map<String, Object> buildSupportFileBundle(List<OperationsMap> allOperations, List<ModelMap> allModels, List<ModelMap> aliasModels, List<WebhooksMap> allWebhooks) {
Map<String, Object> bundle = new HashMap<>(config.additionalProperties());
bundle.put("apiPackage", config.apiPackage());
@ -1100,6 +1102,7 @@ public class DefaultGenerator implements Generator {
bundle.put("apiInfo", apis);
bundle.put("webhooks", allWebhooks);
bundle.put("models", allModels);
bundle.put("aliasModels", aliasModels);
bundle.put("apiFolder", config.apiPackage().replace('.', File.separatorChar));
bundle.put("modelPackage", config.modelPackage());
bundle.put("library", config.getLibrary());
@ -1225,7 +1228,8 @@ public class DefaultGenerator implements Generator {
// models
List<String> filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI);
List<ModelMap> allModels = new ArrayList<>();
generateModels(files, allModels, filteredSchemas);
List<ModelMap> aliasModels = new ArrayList<>();
generateModels(files, allModels, filteredSchemas, aliasModels);
// apis
List<OperationsMap> allOperations = new ArrayList<>();
generateApis(files, allOperations, allModels);
@ -1233,7 +1237,7 @@ public class DefaultGenerator implements Generator {
List<WebhooksMap> allWebhooks = new ArrayList<>();
generateWebhooks(files, allWebhooks, allModels);
// supporting files
Map<String, Object> bundle = buildSupportFileBundle(allOperations, allModels, allWebhooks);
Map<String, Object> bundle = buildSupportFileBundle(allOperations, allModels, aliasModels, allWebhooks);
generateSupportingFiles(files, bundle);
if (dryRun) {

View File

@ -151,6 +151,12 @@
{{/model}}
{{/models}}
{{#aliasModels}}
{{#model}}
defs["{{name}}"] = {{{modelJson}}};
{{/model}}
{{/aliasModels}}
var errs = {};
{{#swagger.vendorExtensions.x-shared-errors}}
{
@ -459,11 +465,13 @@
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {

View File

@ -1703,7 +1703,8 @@ public class DefaultCodegenTest {
List<File> files = new ArrayList<>();
List<String> filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI);
List<ModelMap> allModels = new ArrayList<>();
generator.generateModels(files, allModels, filteredSchemas);
List<ModelMap> aliasModels = new ArrayList<>();
generator.generateModels(files, allModels, filteredSchemas, aliasModels);
// check that the model's children contain the x-discriminator-values
modelName = "BaseObj";

View File

@ -660,11 +660,12 @@ public class DefaultGeneratorTest {
List<File> files = new ArrayList<>();
List<String> filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI);
List<ModelMap> allModels = new ArrayList<>();
generator.generateModels(files, allModels, filteredSchemas);
List<ModelMap> aliasModels = new ArrayList<>();
generator.generateModels(files, allModels, filteredSchemas, aliasModels);
List<OperationsMap> allOperations = new ArrayList<>();
generator.generateApis(files, allOperations, allModels);
Map<String, Object> bundle = generator.buildSupportFileBundle(allOperations, allModels);
Map<String, Object> bundle = generator.buildSupportFileBundle(allOperations, allModels, aliasModels);
LinkedList<CodegenServer> servers = (LinkedList<CodegenServer>) bundle.get("servers");
Assert.assertEquals(servers.get(0).url, "");
Assert.assertEquals(servers.get(1).url, "http://trailingshlash.io:80/v1");
@ -686,11 +687,12 @@ public class DefaultGeneratorTest {
List<File> files = new ArrayList<>();
List<String> filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI);
List<ModelMap> allModels = new ArrayList<>();
generator.generateModels(files, allModels, filteredSchemas);
List<ModelMap> aliasModels = new ArrayList<>();
generator.generateModels(files, allModels, filteredSchemas, aliasModels);
List<OperationsMap> allOperations = new ArrayList<>();
generator.generateApis(files, allOperations, allModels);
Map<String, Object> bundle = generator.buildSupportFileBundle(allOperations, allModels);
Map<String, Object> bundle = generator.buildSupportFileBundle(allOperations, allModels, aliasModels);
LinkedList<CodegenServer> servers = (LinkedList<CodegenServer>) bundle.get("servers");
Assert.assertEquals(servers.get(0).url, "/relative/url");
}
@ -768,8 +770,9 @@ public class DefaultGeneratorTest {
List<File> files = new ArrayList<>();
List<String> filteredSchemas = ModelUtils.getSchemasUsedOnlyInFormParam(openAPI);
List<ModelMap> allModels = new ArrayList<>();
List<ModelMap> aliasModels = new ArrayList<>();
// The bug causes a StackOverflowError when calling generateModels
generator.generateModels(files, allModels, filteredSchemas);
generator.generateModels(files, allModels, filteredSchemas, aliasModels);
// all fine, we have passed
}
}

View File

@ -1017,6 +1017,7 @@ ul.nav-tabs {
}
};
var errs = {};
</script>
@ -1560,11 +1561,13 @@ $(document).ready(function() {
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -1622,11 +1625,13 @@ $(document).ready(function() {
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -2043,11 +2048,13 @@ Pet id to delete
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -2452,11 +2459,13 @@ Status values that need to be considered for filter
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -2514,11 +2523,13 @@ Status values that need to be considered for filter
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -2923,11 +2934,13 @@ Tags to filter by
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -2985,11 +2998,13 @@ Tags to filter by
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -3400,11 +3415,13 @@ ID of pet to return
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -3462,11 +3479,13 @@ ID of pet to return
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -3524,11 +3543,13 @@ ID of pet to return
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -3992,11 +4013,13 @@ $(document).ready(function() {
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -4054,11 +4077,13 @@ $(document).ready(function() {
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -4116,11 +4141,13 @@ $(document).ready(function() {
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -4178,11 +4205,13 @@ $(document).ready(function() {
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -4634,11 +4663,13 @@ Updated status of the pet
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -5115,11 +5146,13 @@ file to upload
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -5463,11 +5496,13 @@ ID of the order that needs to be deleted
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -5525,11 +5560,13 @@ ID of the order that needs to be deleted
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -5895,11 +5932,13 @@ pub fn main() {
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -6270,11 +6309,13 @@ ID of pet that needs to be fetched
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -6332,11 +6373,13 @@ ID of pet that needs to be fetched
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -6394,11 +6437,13 @@ ID of pet that needs to be fetched
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -6794,11 +6839,13 @@ $(document).ready(function() {
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -6856,11 +6903,13 @@ $(document).ready(function() {
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -7274,11 +7323,13 @@ $(document).ready(function() {
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -7692,11 +7743,13 @@ $(document).ready(function() {
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -8110,11 +8163,13 @@ $(document).ready(function() {
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -8495,11 +8550,13 @@ The name that needs to be deleted
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -8557,11 +8614,13 @@ The name that needs to be deleted
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -8929,11 +8988,13 @@ The name that needs to be fetched. Use user1 for testing.
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -8991,11 +9052,13 @@ The name that needs to be fetched. Use user1 for testing.
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -9053,11 +9116,13 @@ The name that needs to be fetched. Use user1 for testing.
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -9491,11 +9556,13 @@ The password for login in clear text
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -9581,11 +9648,13 @@ The password for login in clear text
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -9925,11 +9994,13 @@ pub fn main() {
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -10381,11 +10452,13 @@ $(document).ready(function() {
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {
@ -10443,11 +10516,13 @@ $(document).ready(function() {
}
if (schema.$ref != null) {
schema = defsParser.$refs.get(schema.$ref);
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
if (schema.properties != null) {
Object.keys(schema.properties).forEach( (item) => {
if (schema.properties[item].$ref != null) {
schema.properties[item] = defsParser.$refs.get(schema.properties[item].$ref);
}
});
}
} else if (schema.items != null && schema.items.$ref != null) {
schema.items = defsParser.$refs.get(schema.items.$ref);
} else {