IDL: Inter-parameter Dependency Language

Inter-Parameter Dependency Language (IDL) is a textual domain-specific language for the specification of dependencies among input parameters in web APIs.

          
IF videoDimension THEN type=='video';          // Requires
Or(title, description);                        // Or
OnlyOne(From, MessagingServiceSid);            // OnlyOne
AllOrNone(subject_id, subject_type);           // AllOrNone
ZeroOrOne(radius, rankby=='distance');         // ZeroOrOne
max_id >= since_id;                            // Relational
offset + limit <= 1000;                        // Arithmetic
IF type=='video' THEN OnlyOne(embed, data);    // Complex
          
  

IDL4OAS: An OAS Extension

"Extend your Open API Specification (OAS) documents with IDL dependencies and take automation to the next level: consistency checking, automated testing, code generation and more!".



IDL dependencies can be straightforwardly specified in OAS specifications using IDL4OAS, an OAS extension. You just need to include the keyword x-dependencies at the operation level, and include the list of dependencies as an array.

IDL4OAS
            
  paths:
    /example/route:
      get:
        operationId: exampleOperation
        parameters:
          - in: query
            type: boolean
            required: false
            name: p1
          - in: query
            type: integer
            required: false
            name: p2
          - in: query
            type: string
            required: false
            name: p3
        x-dependencies:
          - Or(p1, p2, p3);
          - IF p1==true THEN p2;
            
          

Automated Analysis

Check the consistency of IDL specification and identify bugs automatically by using IDLReasoner, a Java tool for the automated analysis of IDL specifications using constraint programming."

Are you interested in integrating these analyses in your own product? Have a look to the IDLReasoner REST API.


Automated Testing

Dependency-aware test case generation is supported by RESTest, a Java framework for the automated testing of REST APIs. Check how we found hundreds of bugs in industrial APIs leveraging our tools for the automated analysis of IDL dependencies.

RESTest

Code Generation

IDL dependencies can be straightforwardly specified in OAS specifications using IDL4OAS, an OAS extension. You just need to include the keyword x-dependencies at the operation level, and include the list of dependencies as an array.

CodeGeneration
Top