liveBook · Manning

InputConfig

As explained in API Design Patterns

InputConfig is a configuration object that specifies how externally supplied bytes are decoded and prepared for import.

InputConfig specifies how externally supplied bytes are transported, transformed, and prepared for import. It keeps storage access separate from decoding and processing so one data source can serve multiple resource types. section 23.2 section 23.3.3

Configure the input around the transformation pipeline:

  • Specify the content type, such as JSON or CSV, or leave it undefined for auto-detection. section 23.3.3
  • Specify compression, such as ZIP or BZ2, or leave it undefined when the input is uncompressed. section 23.3.3
  • Keep transport settings in a DataSource rather than mixing external storage access with decoding settings. section 23.2

Message import configuration

A resource-specific configuration can declare `contentType: "csv"` and `compressionFormat: "zip"`. The service retrieves the bytes, decompresses them, and deserializes them into Message resources before applying import behavior. section 23.3.3 section 23.3.8

Listing 23.6 Example input and output configuration for Message resources
interface MessageInputConfig {           #1    
  // The content type of the input.
  // Choices: "json", "csv", undefined (auto-detected)
  contentType?: string;
 
  // Choices: "zip", "bz2", undefined (not compressed)
  compressionFormat?: string;
}
 
interface MessageOutputConfig {          #1
  // The content type for serialization.
  // Choices: "json", "csv", undefined for default.
  contentType?: string;
 
  // Use ${number} for a zero-padded file ID number.
  // Content type will be appended with file extension (e.g., ".json").
  // Default: "messages-part-${number}"
  filenameTemplate?: string;
 
  maxFileSizeMb?: number;
 
  // Choices: "zip", "bz2", undefined (not compressed)
  compressionFormat?: string;
}

Inspect the complete Message input and output configuration shape, including supported content types and compression formats. section 23.3.3

Do not place import filtering inside InputConfig. Filtering occurs after retrieval and decoding, may depend on API-computed fields, and is better performed before the import operation. section 23.3.8

How API Design Patterns covers it

How deep it goes
Defines configuration boundaries and processing order, but defers detailed failure, consistency, and retry behavior.
Examples
Uses MessageInputConfig with JSON or CSV content and ZIP or BZ2 compression, alongside a sample CSV representation.
What it assumes
Assumes familiarity with serialized bytes, external storage, resource imports, and data transformation.
What you can do after
Configure imports with resource-specific decoding and compression settings while keeping storage transport independently reusable.
How it connects
Connects data sources, serialization, deserialization, compression, encryption, resource imports, and filtering.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of API Design Patterns. The section links point to the parts of the book it draws on.