Skip to content

fix(salesforce): name the fallback dataType in the warning - #561

Merged
jbonofre merged 1 commit into
apache:mainfrom
RyutoYoda:fix/salesforce-name-the-fallback-datatype
Oct 11, 2026
Merged

jbonofre merged 1 commit into
apache:mainfrom
RyutoYoda:fix/salesforce-name-the-fallback-datatype

Conversation

@RyutoYoda

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #550, answering the review question there.

A field with an explicit Ossie datatype that has no safe Salesforce mapping
(Time, Opaque) and no Salesforce extension takes the role default, so a
Time measurement ships as Number. The warning said a default was applied
but not which one, so the change in meaning was invisible in the log:

-... with no safe Salesforce mapping; falling back to the default dataType for its role
+... with no safe Salesforce mapping; exporting it as 'Number', the default dataType for its role

The review's other option, applying the default only when datatype is null,
would send Time and Opaque fields to the API with no dataType again, which
is the HTTP 500 #550 fixed.

Verification

  • mvn -B clean verify: 334 tests, 0 failures. main is 333, so this adds one
    and breaks nothing. apache-rat:check clean.
  • Reverting only the main-code change fails the new test.
  • Export output is unaffected: the same model exported on main and on this
    branch gives byte-identical JSON, so only the log line changes.

Related Issues

No existing issue covers this.

Checklist

Sections this change does not touch (Specification, Ontology, Validation,
Examples, Documentation) are omitted rather than left unchecked.

Converters

  • Converter logic updated
  • Tests live under the converter's test directory

Tests

  • All existing tests pass: 334 passed locally, green on the CI profile
  • New behaviour is covered by a test that fails without the fix

Compliance

  • ASF license headers present (no new files added)
  • No third-party dependencies added

@jbonofre jbonofre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Passing the FieldType into applyOssieDatatype makes the fallback warning name the dataType that applyFieldDefaults actually applies. Both call sites pass the correct type. The new test cover the fallback path: Time has no mapper entry, so it falls back to Number as a measurement.

@jbonofre
jbonofre merged commit 08244b5 into apache:main Oct 11, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants