Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes NULL values in ipinfo <ip> in YAML format #162

Merged
merged 3 commits into from
Aug 18, 2023
Merged

Conversation

Harisabdullah
Copy link
Contributor

No description provided.

@linear
Copy link

linear bot commented Aug 9, 2023

BE-2226 CLI YAML output should remove `null` entries

For out-of-tier data YAML option should not return any values instead of the current null response.

ipinfo ► ipinfo 8.8.8.8 --yaml
ip: 8.8.8.8
hostname: dns.google
bogon: false
anycast: true
city: Mountain View
region: California
country: US
countryname: United States
countryflag:
emoji: "\\U0001F1FA\\U0001F1F8"
unicode: U+1F1FA U+1F1F8
countrycurrency:
code: USD
symbol: $
continent:
code: NA
name: North America
iseu: false
location: 37.4056,-122.0775
org: AS15169 Google LLC
postal: "94043"
timezone: America/Los_Angeles
asn: null
company: null
carrier: null
privacy: null
abuse: null
domains: null

Preferred response:

ipinfo ► ipinfo 8.8.8.8 --yaml
ip: 8.8.8.8
hostname: dns.google
bogon: false
anycast: true
city: Mountain View
region: California
country: US
countryname: United States
countryflag:
emoji: "\\U0001F1FA\\U0001F1F8"
unicode: U+1F1FA U+1F1F8
countrycurrency:
code: USD
symbol: $
continent:
code: NA
name: North America
iseu: false
location: 37.4056,-122.0775
org: AS15169 Google LLC
postal: "94043"
timezone: America/Los_Angeles

This will match our normal response:

ipinfo ► ipinfo 8.8.8.8
Core

- IP 8.8.8.8
- Anycast true
- Hostname dns.google
- City Mountain View
- Region California
- Country United States (US)
- Currency USD ($)
- Location 37.4056,-122.0775
- Organization AS15169 Google LLC
- Postal 94043
- Timezone America/Los_Angeles

ipinfo ► ipinfo 8.8.8.8 --json
{
"ip": "8.8.8.8",
"hostname": "dns.google",
"anycast": true,
"city": "Mountain View",
"region": "California",
"country": "US",
"country_name": "United States",
"country_flag": {
"emoji": "🇺🇸",
"unicode": "U+1F1FA U+1F1F8"
},
"country_currency": {
"code": "USD",
"symbol": "$"
},
"continent": {
"code": "NA",
"name": "North America"
},
"loc": "37.4056,-122.0775",
"org": "AS15169 Google LLC",
"postal": "94043",
"timezone": "America/Los_Angeles"
}

Copy link
Contributor

@UmanShahzad UmanShahzad left a comment

Choose a reason for hiding this comment

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

We need to make this change in the actual github.com/ipinfo/go repo and update the version, then do go mod vendor here.

"github.com/fatih/color"
"github.com/ipinfo/cli/lib/complete"
"github.com/ipinfo/cli/lib/complete/predict"
"github.com/ipinfo/go/v2/ipinfo"
"github.com/spf13/pflag"
"net"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is wrongly placed

Copy link
Contributor

@UmanShahzad UmanShahzad left a comment

Choose a reason for hiding this comment

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

@Harisabdullah can you quickly wrap this one up by updating the dependency? Then we're good to close

@UmanShahzad UmanShahzad merged commit 5c65719 into master Aug 18, 2023
@UmanShahzad UmanShahzad deleted the haris/BE-2226 branch August 18, 2023 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants