Skip to content

fix(formatter): use primitive type instead of schema name in get_response_type (AAWF-1199)#3723

Merged
walidcavelius merged 1 commit intomasterfrom
walid/fix-get-response-type-primitive
Apr 13, 2026
Merged

fix(formatter): use primitive type instead of schema name in get_response_type (AAWF-1199)#3723
walidcavelius merged 1 commit intomasterfrom
walid/fix-get-response-type-primitive

Conversation

@walidcavelius
Copy link
Copy Markdown
Contributor

Context

When a named component schema has a primitive type (e.g. type: string), get_response_type() used schema_name() directly — emitting the schema name as a class type and generating a model import (com.datadog.api.client.v2.model.<SchemaName>). But no class is generated for primitive schemas, causing a compile error in generated examples.

Example: ConvertCatalogEntityResponse: {type: string} caused the example to import com.datadog.api.client.v2.model.ConvertCatalogEntityResponse which doesn't exist.

Fix

Check simple_type() first — if the schema resolves to a primitive (String, Long, etc.), use that type directly and suppress the model import. Consistent with how type_to_java() already guards against this case.

Test plan

  • Generated examples for operations with primitive response schemas use the primitive type directly instead of a missing class name

…onse_type

When a named component schema has a primitive type (e.g. type: string),
get_response_type() used schema_name() directly, emitting the schema name
as a class type and adding a model import — but no class is generated for
primitive schemas, causing a compile error in generated examples.

Fix: check simple_type() first; if the schema resolves to a primitive,
use that type and suppress the model import. Consistent with how
type_to_java() already guards against this case.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@walidcavelius walidcavelius requested review from a team as code owners April 10, 2026 13:53
@walidcavelius walidcavelius added the changelog/Fixed Fixed features results into a bug fix version bump label Apr 10, 2026
@walidcavelius walidcavelius changed the title fix(formatter): use primitive type instead of schema name in get_response_type fix(formatter): use primitive type instead of schema name in get_response_type (AAWF-1199) Apr 13, 2026
@walidcavelius
Copy link
Copy Markdown
Contributor Author

/remove

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 bot commented Apr 13, 2026

View all feedbacks in Devflow UI.

2026-04-13 09:47:52 UTC ℹ️ Start processing command /remove


2026-04-13 09:47:56 UTC ℹ️ Devflow: /remove

@walidcavelius walidcavelius merged commit 4399578 into master Apr 13, 2026
26 of 28 checks passed
@walidcavelius walidcavelius deleted the walid/fix-get-response-type-primitive branch April 13, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/Fixed Fixed features results into a bug fix version bump mergequeue-status: removed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants