{"openapi":"3.1.0","info":{"title":"TdRules API - Test Data Coverage Evaluation","description":"A set of services to evaluate the coverage of test data.  Coverage criteria are implemented in a set of rules, that when evaluated with respect to a given data store determine the coverage of the data store with respect to the query. Two kind of coverage rules are generated, Full Predicate Coverage (FPC) Rules and SQL Mutants. ","termsOfService":"https://in2test.lsi.uniovi.es/sqltools/common/TERMS_OF_USE.html","contact":{"name":"Software Engineering Research Group (GIIS)","url":"https://giis.uniovi.es"},"version":"4.5.31-api-4.0.2"},"servers":[{"url":"https://in2test.lsi.uniovi.es/tdrules/api/v4"}],"tags":[{"name":"TdRules","description":"the TdRules API"}],"paths":{"/rules":{"post":{"tags":["TdRules"],"summary":"Gets the FPC rules for a given query. Based on Modified Condition Decision Coverage (MCDC) for SQL.  Each rule is a SQL-like statement that is covered if the execution against the data store returns at least one item. Query syntax depends on the underlying schema: - For RDB schemas is a full fledged SQL. - For OpenApi schemas is a variant of SQL called Test Data Specification (TDS). ","operationId":"rulesPost","requestBody":{"content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/TdRulesBody"}},"application/json; charset=utf-8":{"schema":{"$ref":"#/components/schemas/TdRulesBody"}}},"required":true},"responses":{"200":{"description":"The generated TdRules object that includes the FPC Rules or Mutants","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdRules"}}}}}}},"/query/parameters":{"post":{"tags":["TdRules"],"summary":"Transforms a non parametrized query into a parametrized one by converting each literal into a parameter and returns the mapping parameter-values","operationId":"queryParametersPost","parameters":[{"name":"storetype","in":"query","required":false,"schema":{"type":"string","default":""}}],"requestBody":{"content":{"application/json;charset=utf-8":{"schema":{"type":"string","description":"An object that includes the query to be processed"}},"application/json; charset=utf-8":{"schema":{"type":"string","description":"An object that includes the query to be processed"}}}},"responses":{"200":{"description":"An object that contains the parametrized query and the mapping parameter-values","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryParametersBody"}}}}}}},"/query/entities":{"post":{"tags":["TdRules"],"summary":"Gets the set of entities referenced in a query","operationId":"queryEntitiesPost","parameters":[{"name":"storetype","in":"query","required":false,"schema":{"type":"string","default":""}}],"requestBody":{"content":{"application/json;charset=utf-8":{"schema":{"type":"string","description":"An object that includes the query to be processed"}},"application/json; charset=utf-8":{"schema":{"type":"string","description":"An object that includes the query to be processed"}}}},"responses":{"200":{"description":"An object that contains the list of the entities referenced by the query","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryEntitiesBody"}}}}}}},"/mutants":{"post":{"tags":["TdRules"],"summary":"Gets the set of mutants for a given SQL (SQLMutation). Only available for relational databases. Each rule is a mutant of the original SQL query. The mutant is dead (i.e. the rule is covered) if the execution against the database returns the same rows than the original query.","operationId":"mutantsPost","requestBody":{"content":{"application/json;charset=utf-8":{"schema":{"$ref":"#/components/schemas/TdRulesBody"}},"application/json; charset=utf-8":{"schema":{"$ref":"#/components/schemas/TdRulesBody"}}},"required":true},"responses":{"200":{"description":"The generated TdRules object with the mutants","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TdRules"}}}}}}},"/version":{"get":{"tags":["TdRules"],"summary":"Returns information about the version and environment of the service","operationId":"versionGet","responses":{"200":{"description":"The information about the version and environment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionBody"}}}}}}},"/healthcheck":{"get":{"tags":["TdRules"],"summary":"Healthcheck entry point","operationId":"healthcheckGet","responses":{"200":{"description":"Returns OK if service is running","content":{"text/plain":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"TdRule":{"type":"object","description":"Represents a single coverage rule. In RDB, this query can be executed against the database to determine if it is covered","properties":{"summary":{"type":"object","additionalProperties":{"type":"string"},"description":"A map of additional properties to store information about the evaluation of the rule"},"id":{"type":"string","description":"Unique identifier of this rule in a set of rules"},"category":{"type":"string","description":"Top level classification of this rule"},"maintype":{"type":"string","description":"Second level classification of this rule"},"subtype":{"type":"string","description":"Third level classification of this rule"},"location":{"type":"string","description":"Identification about the place of the query that has been considered to generate the rule"},"equivalent":{"type":"string","description":"Only for mutants, indicates if this is an equivalent mutant"},"query":{"type":"string","description":"The query expression that describes this rule"},"description":{"type":"string","description":"An human readable textual description of what this rule represents"},"error":{"type":"string","description":"This field can be used to store runtime errors when generating or evaluating this rule"}}},"TdRules":{"type":"object","description":"Represents a set of coverage rules (FPC or mutants) that have been generated from a query","properties":{"rulesClass":{"type":"string","description":"The class of the rules generated (`fpc` or `mutation`)"},"version":{"type":"string","description":"The version number of the service that generates this rule"},"environment":{"type":"string","description":"The environment of the service that generates this rule (e.g. development, production)"},"summary":{"type":"object","additionalProperties":{"type":"string"},"description":"A map of additional properties to store information about the results of the evaluation of the coverage or other application specific properties"},"query":{"type":"string","description":"The query expression that generated the rules"},"parsedquery":{"type":"string","description":"The query after being parsed (only if specified by the `options` used when calling the service)"},"error":{"type":"string","description":"If empty, the service successfully obtained the rules, if not, indicates the error occurred, eg. the query is not syntactically correct. This field can be used to store runtime errors when executing generating the rules or executing the query"},"rules":{"type":"array","description":"The set of rules generated","items":{"$ref":"#/components/schemas/TdRule"}}}},"Ddl":{"type":"object","description":"Represents an operation to modify the data or the schema in a data store (store type dependent). ","properties":{"command":{"type":"string","description":"The kind of operation to be executed: - In RDB stores: the command is the type of statement (e.g. create, drop) to be executed. - In OpenApi data stores: the command is the http method (e.g. post, put) to be executed. "},"query":{"type":"string","description":"The statement or path where command is to be executed: - In RDB stores: the SQL or DML statement to be executed. - In OpenApi data stores: he path (endpoint) where the command is to be executed. "}},"required":["command","query"]},"TdAttribute":{"type":"object","description":"Represents an attribute in an entity. To generate coverage rules, at least `name` and `dtype` must be specified","properties":{"name":{"type":"string","description":"The name of this attribute"},"datatype":{"type":"string","description":"The data type name of this attribute."},"compositetype":{"type":"string","description":"If the data type is not primitive this attibute holds `array` or `type`."},"subtype":{"type":"string","description":"An optional modifier of the data type, eg. given a `DATETIME WITH TIMEZONE` in an RDB, this field stores `WITH TIMEZONE` and the `datatype` field stores `DATETIME`"},"size":{"type":"string","description":"An optional size of the data type of this attribute. eg. given a `DECIMAL(10,2)` in a RDB, this field stores the value `10,2`"},"uid":{"type":"string","description":"If this value is `true`, the attribute is the unique identifier (or part thereof) of the data stored"},"autoincrement":{"type":"string","description":"If this value is `true`, the value of the attribute is autogenerated in the backend when a new instance is created"},"notnull":{"type":"string","description":"If this value is `true`, the attribute is not nullable"},"readonly":{"type":"string","description":"If this value is `true`, the attribute should not be sent as part of a request to update the data store"},"rid":{"type":"string","description":"If this value is non empty, represents a reference to an attribute in another entity (e.g. foreign key in RDB). This value must be in the form `<entity-name>.<attribute-name>`"},"ridname":{"type":"string","description":"An optional name to refer this 'rid'"},"checkin":{"type":"string","description":"A list of allowed literals to constraint the possible values of this attribute, e.g. `'Y','N'` represents a field that can have only these two values"},"defaultvalue":{"type":"string","description":"If this value is non empty, indicates the default value applicable to this attribute"},"extended":{"type":"object","additionalProperties":{"type":"string"},"description":"A map of additional attribute properties to store information required by other applications"}}},"TdCheck":{"type":"object","description":"Represents a logical expression that constraints the allowed values of attributes in an entity","properties":{"attribute":{"type":"string","description":"The name of the attribute that constrained (if associated to only one)"},"name":{"type":"string","description":"An optional name to refer this constraint"},"constraint":{"type":"string","description":"The data store dependent constraint expression"}},"required":["constraint"]},"TdEntity":{"type":"object","description":"Represents a entity in the data store. To generate coverage rules, at least `name` must be specified","properties":{"name":{"type":"string","description":"The name of this entity"},"entitytype":{"type":"string","description":"The type of this entity: - `table`: The entity is meant to store data (objects or rows). - `array`: The entity represents the data stored by each item in a collection inside an entity. - `type`: The entity represents the data stored by a nested object in an entity. - `view`: The entity is a virtual table to present data stored in other entities. "},"subtype":{"type":"string","description":"An optional modifier of the entity type"},"extended":{"type":"object","additionalProperties":{"type":"string"},"description":"A map of additional entity properties to store information required by other applications"},"attributes":{"type":"array","description":"The collection with the attributes of this entity","items":{"$ref":"#/components/schemas/TdAttribute"}},"checks":{"type":"array","description":"The set of constraints that the attributes of this entity must satisfy","items":{"$ref":"#/components/schemas/TdCheck"}},"ddls":{"type":"array","description":"Store type dependent operations to manipulate the data or the schema in the data store: - In RDB stores, it may include the statements to create or drop tables. - In OpenApi data stores, it may include the endpoints to post or delete objects. ","items":{"$ref":"#/components/schemas/Ddl"}}}},"TdRulesBody":{"type":"object","description":"An object that includes the SQL query, schema and an optional string with parameters","properties":{"query":{"type":"string","description":"The query to generate the coverage rules"},"schema":{"$ref":"#/components/schemas/TdSchema"},"options":{"type":"string","description":"A set of additional options to modify the behaviour of the rule generation (strings separated by space). See the list of available options in https://in2test.lsi.uniovi.es/sqltools/sqlrules/#options. <br/>Example. `lang=en noboundary` specifies that the generated fpc coverage rules must contain an english description of the rule and rules for checking boundary values must not be generated."}}},"TdSchema":{"type":"object","description":"Represents the structure of the data store.","properties":{"catalog":{"type":"string","description":"An optional logical namespace that can contain multiple schemas (e.g. the name of the database catalog as returned by JDBC in RDBMS)"},"schema":{"type":"string","description":"An optional name to uniquely identify the data store in a catalog"},"storetype":{"type":"string","description":"A string representing the store type. It is used by the applications to handle the variability of different data stores: - In an RDB: is the database vendor name returned by jdbc, eg. `postgres`, `oracle`, `sqlserver`. - In OpenApi data store: is the string `openapi`. "},"entities":{"type":"array","description":"The set of entities that compose this schema","items":{"$ref":"#/components/schemas/TdEntity"}}}},"QueryParam":{"type":"object","description":"Represents a mapping of a parameter and its value","properties":{"name":{"type":"string","description":"the name of the parameter"},"value":{"type":"string","description":"the value that is assigned to the parameter"}}},"QueryParametersBody":{"type":"object","description":"Represents a transformed parametrized query and the mapping parameter-values","properties":{"query":{"type":"string","description":"The source (non-parametrized)"},"parsedquery":{"type":"string","description":"The transformed parametrized query"},"error":{"type":"string","description":"If empty, the service successfully obtained this object, if not, indicates the error occurred"},"parameters":{"type":"array","description":"The list of parameters that have been extracted from the query","items":{"$ref":"#/components/schemas/QueryParam"}}}},"QueryEntitiesBody":{"type":"object","description":"Represents a collection of entities that are used in a query","properties":{"query":{"type":"string","description":"The query that contains this collection of entities"},"error":{"type":"string","description":"If empty, the service successfully obtained this object, if not, indicates the error occurred"},"entities":{"type":"array","description":"The list of entities used by this query","items":{"type":"string"}}}},"VersionBody":{"type":"object","description":"Contains information about the service versions","properties":{"serviceVersion":{"type":"string","description":"The version number of the running service"},"apiVersion":{"type":"string","description":"The version number of the api implemented by the service"},"environment":{"type":"string","description":"The environment where the service is executing"}}}}}}