use of io.apicurio.datamodels.openapi.models.OasResponses in project apicurio-data-models by Apicurio.
the class DeleteResponseCommand method undo.
/**
* @see io.apicurio.datamodels.cmd.ICommand#undo(io.apicurio.datamodels.core.models.Document)
*/
@Override
public void undo(Document document) {
LoggerCompat.info("[DeleteResponseCommand] Reverting.");
if (this.isNullOrUndefined(this._oldResponse)) {
return;
}
OasResponses responses = (OasResponses) this._responsesPath.resolve(document);
if (this.isNullOrUndefined(responses)) {
return;
}
OasResponse response = responses.createResponse(this._responseCode);
Library.readNode(this._oldResponse, response);
if (this.isNullOrUndefined(this._responseCode)) {
responses.default_ = response;
} else {
responses.addResponse(this._responseCode, response);
}
}
use of io.apicurio.datamodels.openapi.models.OasResponses in project apicurio-data-models by Apicurio.
the class Oas20Operation method createResponses.
/**
* @see io.apicurio.datamodels.openapi.models.OasOperation#createResponses()
*/
@Override
public OasResponses createResponses() {
OasResponses responses = new Oas20Responses();
responses._ownerDocument = this.ownerDocument();
responses._parent = this;
return responses;
}
use of io.apicurio.datamodels.openapi.models.OasResponses in project apicurio-data-models by Apicurio.
the class Oas30Operation method createResponses.
/**
* @see io.apicurio.datamodels.openapi.models.OasOperation#createResponses()
*/
@Override
public OasResponses createResponses() {
OasResponses responses = new Oas30Responses();
responses._ownerDocument = this.ownerDocument();
responses._parent = this;
return responses;
}
use of io.apicurio.datamodels.openapi.models.OasResponses in project apicurio-data-models by Apicurio.
the class DeleteAllResponsesCommand method readNode.
/**
* @see io.apicurio.datamodels.cmd.commands.DeleteNodeCommand#readNode(io.apicurio.datamodels.core.models.Document, java.lang.Object)
*/
@Override
protected OasResponses readNode(Document doc, Object node) {
OasOperation operation = (OasOperation) this._parentPath.resolve(doc);
OasResponses responses = operation.createResponses();
Library.readNode(node, responses);
return responses;
}
use of io.apicurio.datamodels.openapi.models.OasResponses in project apicurio-data-models by Apicurio.
the class DeleteResponseCommand method execute.
/**
* @see io.apicurio.datamodels.cmd.ICommand#execute(io.apicurio.datamodels.core.models.Document)
*/
@Override
public void execute(Document document) {
LoggerCompat.info("[DeleteResponseCommand] Executing.");
this._oldResponse = null;
OasResponse response = (OasResponse) this._responsePath.resolve(document);
if (this.isNullOrUndefined(response)) {
return;
}
OasResponses responses = (OasResponses) response.parent();
if (this.isNullOrUndefined(this._responseCode)) {
responses.default_ = null;
} else {
responses.removeResponse(this._responseCode);
}
this._oldResponse = Library.writeNode(response);
}
Aggregations