oxidecomputer / oxidecomputer/omicron

IP range JSON validation error is not helpful

Open
#4,968 0 comments 0 reactions 1 assignee View on GitHub

@david-crespo is already working on this.

Since Mar 20, 2024.

api
Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

I tried various kinds of bad IP range and they all have the same horrible message, even when the addresses themselves are valid but first > last or one is IPv4 and the other is IPv6.

> (await oxide.ipPoolRangeRemove({ path: { pool: 'default' }, body: { first: '', last: '' } })).data.message
"unable to parse JSON body: data did not match any variant of untagged enum IpRange"

> (await oxide.ipPoolRangeRemove({ path: { pool: 'default' }, body: { first: 'abc', last: 'def' } })).data.message
"unable to parse JSON body: data did not match any variant of untagged enum IpRange"

> (await oxide.ipPoolRangeRemove({ path: { pool: 'default' }, body: { first: '1.1.1.2', last: '1.1.1.1' } })).data.message
"unable to parse JSON body: data did not match any variant of untagged enum IpRange"

> (await oxide.ipPoolRangeRemove({ path: { pool: 'default' }, body: { first: '1.1.1.2', last: '2001:db8:3333:4444:CCCC:DDDD:EEEE:FFFF' } })).data.message
"unable to parse JSON body: data did not match any variant of untagged enum IpRange" 

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.