Skip to content

[BUG] Error updating App spec: App Ingress authority routing only supports exact matching #937

@SantiColu

Description

@SantiColu

Bug Report

Describe the bug

When updating a DigitalOcean App via Apps.Update, the API responds with:

Error 400. error validating app spec field "ingress.rules.rule.match.authority":
App Ingress authority routing only supports exact matching.

This happens even when the caller explicitly sets authority.exact = "", which is a valid value according to the DigitalOcean App Platform API and is accepted when sent as raw JSON.

The root cause is the following model definition in godo:

// AppIngressSpecRuleStringMatch The string match configuration.
type AppIngressSpecRuleStringMatch struct {
	// Prefix-based match. For example, `/api` will match `/api`, `/api/`, and any nested paths such as `/api/v1/endpoint`.
	Prefix string `json:"prefix,omitempty"`
	Exact  string `json:"exact,omitempty"`
}

Because Exact is a string with the omitempty tag, setting it to "" causes the field to be omitted during JSON marshaling, resulting in:

"authority": {}

Instead of the required:

"authority": {
  "exact": ""
}

This makes it impossible to send a valid App Spec using the typed godo structs when an empty exact authority match is required.


Affected Resource(s)

  • Apps (Apps.Update)

Actual Behavior

  • Calling Apps.Update with Authority.Exact = "" results in the exact field being omitted from the request payload.
  • The DigitalOcean API rejects the request with a 400 validation error.
  • There is no way to force "exact": "" using the current godo model definitions.

Expected Behavior

  • Setting Authority.Exact = "" should result in "exact": "" being included in the marshaled JSON.
  • It should be possible to express all valid DigitalOcean App Platform configurations using the provided godo structs, without requiring raw JSON or manual requests.

Steps to Reproduce

  1. Create or fetch an existing App with an ingress rule.
  2. Set the ingress rule authority match to use an empty exact match:
    rule.Match.Authority.Exact = ""
  3. Call:
    client.Apps.Update(ctx, appID, updateReq)
  4. Observe the API response:
    Error 400. error validating app spec field "ingress.rules.rule.match.authority":
    App Ingress authority routing only supports exact matching.
    

Suggested Fix

Change the Exact field to allow explicit empty values, for example by:

  • Removing omitempty from the Exact field tag, or
  • Changing the type to *string and omitting omitempty, allowing callers to explicitly set an empty string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions