5055

YAML In, YAML Out

Integrations
Medium
Pro
yaml
json
configuration
error-handling
api

YAML in, YAML out

Your ops team keeps each environment's connector settings in a YAML file in the deployment repo — pipelines speak YAML, not JSON. At deploy time your extension must swallow that file into setup records, and when ops snapshots an environment it must produce the same document back from those records. You are building both directions of that bridge.

Requirements

The starter ships two tables — keep their names, field names and types exactly as given, because the grading tests read and seed the records directly:

  • "Env Config Setup" — primary key "Config Code" (Code[20]); fields "Environment Name" (Text[100]), Production (Boolean), "Api Base Url" (Text[250]), "Timeout Seconds" (Integer), "Retry Limit" (Integer).
  • "Env Config Feature" — primary key "Config Code" (Code[20]) + Position (Integer); fields "Feature Key" (Code[30]), Enabled (Boolean).

Implement the codeunit named "Env Config Yaml" with exactly these two public procedures:

procedure ImportConfig(ConfigCode: Code[20]; YamlText: Text)
procedure ExportConfig(ConfigCode: Code[20]): Text

Keep your object IDs in the 50100–50199 range and reference other objects by name, never by ID.

The document

environment:
  name: SANDBOX-EU
  production: false
api:
  baseUrl: https://api.example.com/v2
  timeoutSeconds: 30
  retryLimit: 5
features:
  - key: TELEMETRY
    enabled: true
  - key: AUTOSYNC
    enabled: false
YAML path Type Record field
environment.name string "Environment Name"
environment.production boolean Production
api.baseUrl string "Api Base Url"
api.timeoutSeconds integer "Timeout Seconds"
api.retryLimit integer "Retry Limit"
features[n] (1-based) map of key (string), enabled (boolean) the "Env Config Feature" record with Position = n
The rest of the statement and 3 hints Unlock with Pro
ALBusiness Central 28.5
Pro
Pro problem

Solve it with Pro

You’re reading the opening of the statement. Pro unlocks the whole problem:

  • The full statement
  • Starter code in the browser editor
  • 12 grading tests, run on Business Central 28.5
  • 3 hints
  • The reference solution

Pro also opens all 92 Pro problems and lifts the daily limits on compile checks and submissions.

$10 / month
or $100 / year
Upgrade
This problem is part of Pro
Pro unlocks the full statement, tests, hints and solution. The code editor works on a computer.
Upgrade