Я только что попытался создать Java для моего файла JSON Swagger в редакторе Swagger.К сожалению, ничего не произойдет, если я попытаюсь сгенерировать клиент.
В консоли Dev-Tools Chrome я вижу исключение, но я понятия не имею, что пошло не так и где найти более подробную информацию.
POST https://generator.swagger.io/api/gen/clients/java 500 (Request failed.)
index.js:1 Uncaught (in promise) Error: Request failed.
at index.js:1
at tryCatch (runtime.js:62)
at Generator.invoke [as _invoke] (runtime.js:296)
at Generator.e.(/anonymous function) [as next] (https://editor.swagger.io/dist/swagger-editor-standalone-preset.js:1:104152)
at step (asyncToGenerator.js:17)
at asyncToGenerator.js:28
Это файл JSON, используемый для генерации Java-клиента:
{
"swagger":"2.0",
"info":{
"description":"REST API zur Anlage und Modifikation der Daten",
"title":"Aktivierung / Aktualisierung / Deaktivierung der Daten",
"version":"1"
},
"host":"myhost.server.local:8080",
"basePath":"/metadata-webapp",
"paths":{
"/metadata/deactivate":{
"put":{
"summary":"Metadata Deactivation",
"description":"",
"operationId":"deactivate",
"consumes":[
"application/json"
],
"produces":[
"application/json"
],
"parameters":[
{
"in":"body",
"name":"body",
"description":"metadata key",
"required":true,
"schema":{
"$ref":"#/definitions/MetadataKey"
}
}
],
"responses":{
"200":{
"description":"Request was processed"
},
"400":{
"description":"Bad Request, falls Validierung auf Request Objekt fehlschlägt"
},
"500":{
"description":"Interner Fehler"
}
}
}
},
"/metadata/individual":{
"post":{
"summary":"\tMetadata Insert Individual",
"description":"",
"operationId":"saveIndividual",
"consumes":[
"application/json"
],
"produces":[
"application/json"
],
"parameters":[
{
"in":"body",
"name":"body",
"description":"metadata",
"required":true,
"schema":{
"$ref":"#/definitions/MetadataIndividualInsert"
}
}
],
"responses":{
"200":{
"description":"OK"
},
"400":{
"description":"Invalid Metadata",
"schema":{
"$ref":"#/definitions/MetadataResponse"
}
},
"404":{
"description":"Not found",
"schema":{
"type":"string"
}
},
"405":{
"description":"Method Not Allowed",
"schema":{
"$ref":"#/definitions/MetadataResponse"
}
},
"409":{
"description":"Conflict",
"schema":{
"$ref":"#/definitions/MetadataResponse"
}
},
"500":{
"description":"Internal Server Error"
}
}
},
"put":{
"summary":"Metadata Update Individual",
"description":"",
"operationId":"updateIndividual",
"consumes":[
"application/json"
],
"produces":[
"application/json"
],
"parameters":[
{
"in":"body",
"name":"body",
"description":"metadata",
"required":true,
"schema":{
"$ref":"#/definitions/MetadataUpdate"
}
}
],
"responses":{
"200":{
"description":"Request was processed"
},
"400":{
"description":"Bad Request, falls Validierung auf Request Objekt fehlschlägt"
},
"500":{
"description":"Interner Fehler"
}
}
}
},
"/metadata":{
"post":{
"summary":"\tMetadata Insert",
"description":"",
"operationId":"save",
"consumes":[
"application/json"
],
"produces":[
"application/json"
],
"parameters":[
{
"in":"body",
"name":"body",
"description":"metadata",
"required":true,
"schema":{
"$ref":"#/definitions/MetadataInsert"
}
}
],
"responses":{
"200":{
"description":"OK"
},
"400":{
"description":"Invalid Metadata",
"schema":{
"$ref":"#/definitions/MetadataResponse"
}
},
"404":{
"description":"Not found",
"schema":{
"type":"string"
}
},
"405":{
"description":"Method Not Allowed",
"schema":{
"$ref":"#/definitions/MetadataResponse"
}
},
"409":{
"description":"Conflict",
"schema":{
"$ref":"#/definitions/MetadataResponse"
}
},
"500":{
"description":"Internal Server Error"
}
}
},
"put":{
"summary":"Metadata Update",
"description":"",
"operationId":"update",
"consumes":[
"application/json"
],
"produces":[
"application/json"
],
"parameters":[
{
"in":"body",
"name":"body",
"description":"metadata",
"required":true,
"schema":{
"$ref":"#/definitions/MetadataUpdate"
}
}
],
"responses":{
"200":{
"description":"Request was processed"
},
"400":{
"description":"Bad Request, falls Validierung auf Request Objekt fehlschlägt"
},
"500":{
"description":"Interner Fehler"
}
}
}
}
},
"definitions":{
"MetadataKey":{
"type":"object",
"required":[
"itemId"
],
"properties":{
"itemId":{
"type":"string",
"minLength":1,
"maxLength":36
},
"itemCode":{
"type":"string",
"minLength":0,
"maxLength":10
}
}
},
"MetadataResponse":{
"type":"object",
"required":[
"itemId"
],
"properties":{
"itemId":{
"type":"string",
"minLength":1,
"maxLength":36
},
"itemCode":{
"type":"string",
"minLength":0,
"maxLength":10
},
"returnCode":{
"type":"string",
"enum":[
"OK",
"FAULT",
"IRRELEVANT",
"STATUS",
"TECHNICAL_ERROR"
]
},
"message":{
"type":"string"
}
}
},
"MetadataUpdate":{
"type":"object",
"required":[
"aType",
"codeFrom",
"iType",
"isCodeRangeNumeric",
"lengthOfCodes",
"numberOfCodes",
"oCategory",
"itemId",
"myExtraIds",
"status",
"targetCategory",
"validDays",
"validFrom",
"validUntil"
],
"properties":{
"itemId":{
"type":"string",
"minLength":1,
"maxLength":36
},
"itemCode":{
"type":"string",
"minLength":0,
"maxLength":10
},
"uuid":{
"type":"string"
},
"validFrom":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"validUntil":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"validUntilOriginal":{
"type":"string",
"format":"date-time"
},
"validDays":{
"type":"integer",
"format":"int32"
},
"visibleFrom":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"visibleTo":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"aType":{
"type":"integer",
"format":"int32",
"description":"OFFLINE(1),ONLINE(2),BOTH(3)"
},
"multiRedeem":{
"type":"integer",
"format":"int32",
"minimum":1,
"maximum":2147483647
},
"targetCategory":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"iType":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"oCategory":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"incentiveValueFrom":{
"type":"integer",
"format":"int32"
},
"incentiveValueTo":{
"type":"integer",
"format":"int32"
},
"externalID":{
"type":"string"
},
"couponID":{
"type":"string"
},
"codeFrom":{
"type":"string",
"minLength":1,
"maxLength":2147483647
},
"codeTo":{
"type":"string"
},
"infoText":{
"type":"string"
},
"status":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"numberOfCodes":{
"type":"integer",
"format":"int32",
"minimum":1,
"maximum":2147483647
},
"lengthOfCodes":{
"type":"integer",
"format":"int32",
"minimum":4,
"maximum":2147483647
},
"isCodeRangeNumeric":{
"type":"boolean"
},
"interfaceOrigin":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"myExtraIds":{
"type":"array",
"items":{
"type":"string"
},
"maxItems":2147483647,
"minItems":1
}
}
},
"MetadataIndividualInsert":{
"type":"object",
"required":[
"aType",
"codeFrom",
"iType",
"isCodeRangeNumeric",
"lengthOfCodes",
"numberOfCodes",
"oCategory",
"itemId",
"myExtraIds",
"status",
"targetCategory",
"validDays",
"validFrom",
"validUntil"
],
"properties":{
"itemId":{
"type":"string",
"minLength":1,
"maxLength":36
},
"itemCode":{
"type":"string",
"minLength":0,
"maxLength":10
},
"uuid":{
"type":"string"
},
"validFrom":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"validUntil":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"validUntilOriginal":{
"type":"string",
"format":"date-time"
},
"validDays":{
"type":"integer",
"format":"int32"
},
"visibleFrom":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"visibleTo":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"aType":{
"type":"integer",
"format":"int32",
"description":"OFFLINE(1),ONLINE(2),BOTH(3)"
},
"multiRedeem":{
"type":"integer",
"format":"int32",
"minimum":1,
"maximum":2147483647
},
"targetCategory":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"iType":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"oCategory":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"incentiveValueFrom":{
"type":"integer",
"format":"int32"
},
"incentiveValueTo":{
"type":"integer",
"format":"int32"
},
"externalID":{
"type":"string"
},
"couponID":{
"type":"string"
},
"codeFrom":{
"type":"string",
"minLength":1,
"maxLength":2147483647
},
"codeTo":{
"type":"string"
},
"infoText":{
"type":"string"
},
"status":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"numberOfCodes":{
"type":"integer",
"format":"int32",
"minimum":1,
"maximum":2147483647
},
"lengthOfCodes":{
"type":"integer",
"format":"int32",
"minimum":4,
"maximum":2147483647
},
"isCodeRangeNumeric":{
"type":"boolean"
},
"interfaceOrigin":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"myExtraIds":{
"type":"array",
"items":{
"type":"string"
},
"maxItems":2147483647,
"minItems":1
}
}
},
"MetadataInsert":{
"type":"object",
"required":[
"aType",
"codeFrom",
"iType",
"isCodeRangeNumeric",
"lengthOfCodes",
"numberOfCodes",
"oCategory",
"itemId",
"myExtraIds",
"status",
"targetCategory",
"validDays",
"validFrom",
"validUntil"
],
"properties":{
"itemId":{
"type":"string",
"minLength":1,
"maxLength":36
},
"itemCode":{
"type":"string",
"minLength":0,
"maxLength":10
},
"uuid":{
"type":"string"
},
"validFrom":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"validUntil":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"validUntilOriginal":{
"type":"string",
"format":"date-time"
},
"validDays":{
"type":"integer",
"format":"int32"
},
"visibleFrom":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"visibleTo":{
"type":"string",
"format":"date-time",
"example":"yyyy-MM-dd'T'HH:mm:ssZ"
},
"aType":{
"type":"integer",
"format":"int32",
"description":"OFFLINE(1),ONLINE(2),BOTH(3)"
},
"multiRedeem":{
"type":"integer",
"format":"int32",
"minimum":1,
"maximum":2147483647
},
"targetCategory":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"iType":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"oCategory":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"incentiveValueFrom":{
"type":"integer",
"format":"int32"
},
"incentiveValueTo":{
"type":"integer",
"format":"int32"
},
"externalID":{
"type":"string"
},
"couponID":{
"type":"string"
},
"codeFrom":{
"type":"string",
"minLength":1,
"maxLength":2147483647
},
"codeTo":{
"type":"string"
},
"infoText":{
"type":"string"
},
"status":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"numberOfCodes":{
"type":"integer",
"format":"int32",
"minimum":1,
"maximum":2147483647
},
"lengthOfCodes":{
"type":"integer",
"format":"int32",
"minimum":4,
"maximum":2147483647
},
"isCodeRangeNumeric":{
"type":"boolean"
},
"interfaceOrigin":{
"type":"integer",
"format":"int32",
"description":"desc"
},
"myExtraIds":{
"type":"array",
"items":{
"type":"string"
},
"maxItems":2147483647,
"minItems":1
}
}
}
}
}
Кто-нибудь может дать мне подсказку, что делать или где смотреть?