Skip to content

/api/v2/spending/ budget_function and budget_subfunction can be string or number #4589

Description

@thsmale

This route will return the same results if budget_function is a string or number.

{
	"type": "budget_function",
	"filters": {
		"fy": "2025",
		"quarter": "1",
		"budget_function": 570
	}
}

This becomes more important when you use the budget_function_code for National Defense, 050. The contract says this optional value can only be a number. However, if you try to pass a leading zero 050 you will get a JSON parse error if using a HTTP client like insomnia. The USA Spending explorer for budget_functions passes budget_function and budget_subfunction as strings.

So I think the contract should be updated to allow strings.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions