Skip to content

[Bug] .assets().getV2Assets fails to parse attribute "has_options" (expects "options_enabled") #168

@ramonchu

Description

@ramonchu

Hi 👋

When calling .assets().getV2Assets using the current alpaca-java client, the deserialization of asset attributes fails.

Problem
The enum AttributesEnum defines the value OPTIONS_ENABLED with the JSON mapping "options_enabled".
However, Alpaca’s API v2 actually returns the field as "has_options".
This mismatch causes a parsing error when retrieving assets with options enabled.

var assets = alpacaAPI.trader().assets().getV2Assets();

If the response includes "has_options": true, the client fails because "options_enabled" is expected.

Expected behavior
The client should map "has_options" correctly to the corresponding enum value.

Proposed fix
• Update AttributesEnum to use "has_options" instead of "options_enabled".
• Alternatively, support both values for backwards compatibility.

Environment
• alpaca-java: [version you’re using]
• JDK: [e.g. 17]
• OS: [e.g. MacOS 14.5]

Thanks for maintaining this library 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions