Skip to main content

Overview

WADL Specification: https://api.petstoreapi.com/v1/specs/modern-petstore.wadl Protocol: XML-based description language for HTTP APIs WADL Version: Following the W3C WADL 2009-02 specification WADL is a machine-readable XML format that describes HTTP-based web applications and RESTful web services. It provides a structured way to describe resources, methods, parameters, and representations.

What is WADL?

WADL (Web Application Description Language) is an XML-based file format that provides a machine-readable description of HTTP-based web applications. It was designed to simplify the development and documentation of RESTful web services.

Key Features

  • Resource-Oriented: Describes REST resources and their hierarchies
  • Method Definitions: Specifies HTTP methods (GET, POST, PUT, DELETE, etc.)
  • Parameter Description: Documents path, query, and header parameters
  • Media Types: Defines request and response representations
  • Type System: Uses XML Schema types for validation
  • Tool Generation: Enables automatic client generation

When to Use WADL

WADL is particularly useful when:
  • Working with Java-based web services
  • Using tools that consume WADL (like JAX-RS)
  • Integrating with legacy systems expecting WADL
  • Generating client code from service descriptions
  • Documenting RESTful APIs in XML format

WADL Structure

Our WADL specification follows this structure:

Downloading the WADL Specification

Direct Download

Specification Details

The WADL specification includes:
  • 11 resource paths: All REST API endpoints
  • 18 HTTP methods: Complete CRUD operations
  • Path parameters: Template-style parameters with validation
  • Query parameters: Filtering and pagination support
  • Request bodies: JSON representations with schema references
  • Response definitions: Status codes and media types
  • Documentation: Inline descriptions for all elements

Understanding WADL Elements

Application Element

The root element containing the entire API description:

Resources Element

Defines the base URL and contains all resource definitions:

Resource Element

Represents a REST resource with its path and operations:

Method Element

Describes an HTTP operation on a resource:

Parameter Element

Defines input parameters:
Parameter Styles:
  • template: Path parameters (e.g., /pets/{id})
  • query: Query string parameters (e.g., ?species=DOG)
  • header: HTTP headers (e.g., Authorization)

Representation Element

Describes request/response bodies:

Using WADL

Generate Client Code

WADL enables automatic client generation for various languages:

Java (JAX-RS)

Python (wadllib)

Validate API Calls

Use WADL to validate requests before sending:

API Examples

List Pets

WADL Definition:
HTTP Request:

Get Pet

WADL Definition:
HTTP Request:

Create Pet

WADL Definition:
HTTP Request:

Type System

WADL uses XML Schema Data Types (XSD) for parameter and representation types:

Basic Types

Array Parameters

Use the repeating="true" attribute for array-type parameters:
Usage:

Best Practices

1. Path Parameters at Resource Level

Define path parameters once at the resource level, not repeated in each method:

2. Use Meaningful IDs

Give each method a unique, descriptive ID:

3. Document Everything

Include documentation for all elements:

4. Specify Default Values

Include default values for optional parameters:

WADL vs OpenAPI

When to Choose WADL

Use WADL if:
  • ✅ Working with Java/JAX-RS frameworks
  • ✅ Integrating with legacy enterprise systems
  • ✅ Client tools require WADL format
  • ✅ Using XML-based toolchains

When to Choose OpenAPI

Use OpenAPI if:
  • ✅ Building modern REST APIs
  • ✅ Need human-readable documentation
  • ✅ Want rich tooling ecosystem
  • ✅ Require webhook/callback support
  • ✅ Targeting multiple languages

Tools and Libraries

Java

JAX-RS (Jersey)
Apache CXF

Python

wadllib

Validation

xmllint (libxml2)

Migration Guide

From WADL to OpenAPI

If you’re migrating from WADL to OpenAPI:
  1. Resource Mapping: WADL <resource> → OpenAPI paths
  2. Method Mapping: WADL <method> → OpenAPI operation objects
  3. Parameters: WADL <param> → OpenAPI parameters
  4. Types: XSD types → JSON Schema types
  5. Documentation: WADL <doc> → OpenAPI description
Example Conversion:

From OpenAPI to WADL

Our conversion script (scripts/oas32-to-wadl.mjs) automatically converts OpenAPI to WADL:

Additional Resources


Support

For questions or issues with the WADL specification: