Skip to main content

Rules

What are “definition rules”?

Definition rules are a set of standardized guidelines that describe how to create, name, and document data fields in systems like APIs, forms, or databases. Their main goal is to ensure data consistency, clarity, and compatibility across different systems and teams.

These rules cover aspects like:

  • naming conventions for fields,
  • date, number, and currency formats,
  • use of international standards (e.g., ISO),
  • marking fields as required or optional,
  • providing examples and allowed values (enums).

Well-defined rules help prevent errors, make data easier to validate, and streamline communication between systems and developers.

Definition Rules

Definition Rules

Rule NameDescription
ConsistencyUse a consistent naming and formatting style throughout the entire document.
ISO StandardsPrefer international standards (e.g., ISO 8601 for dates).
LowercaseField names should be written in lowercase, e.g., first_name, email.
Snake_caseUse underscores (_) instead of spaces or camelCase for field names.
Clear DescriptionsEvery field should have a short, clear description and a valid example.
Required / OptionalIndicate whether a field is [required] or [optional].
No AmbiguityBe specific about data types, formats, and constraints.
Enumerated ValuesUse enumerations for fields with a fixed set of values, e.g., `status: active
Deprecated FieldsClearly mark fields that are no longer in use as [deprecated].
ExamplesProvide at least one valid example for each field.

Data Formatting Rules

FieldFormatDescription
DateYYYY-MM-DD (ISO 8601)Year-month-day according to ISO 8601, e.g., 2025-04-11
Date & TimeYYYY-MM-DDTHH:MM:SSZISO 8601 full datetime in UTC, e.g., 2025-04-11T14:30:00Z
First NameCapitalizedFirst letter capital only, no numbers, e.g., "John"
Last NameCapitalizedSame as above, e.g., "Smith"
Emailexample@domain.comA valid email address
Phone Number+48 123 456 789International format with spaces
Amount1234.56Use a dot as the decimal separator
CurrencyPLN / USD / EUR3-letter ISO currency code
Postal Code00-000Two digits, dash, three digits
Country CodePL / DE / US2-letter ISO 3166-1 alpha-2 country code
Language Codepl / en / de2-letter ISO 639-1 language code
Booleantrue / falseLowercase, boolean values only
File Extension.jpg / .png / .pdfAllowed file extensions
Hex Color Code#RRGGBBHTML hex color format, e.g., #FF5733
TimeHH:MM24-hour time format, e.g., 14:30