Skip to content

Commit e6f9a9c

Browse files
committed
Remove checked_at
1 parent 877051c commit e6f9a9c

4 files changed

Lines changed: 4 additions & 22 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ Example response:
6565
{
6666
"domain": "example.com",
6767
"available": true,
68-
"checked_at": "2026-04-24T12:34:56Z",
6968
"status": "ok"
7069
}
7170
```

app/routers/domain.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
class AvailabilityResult(BaseModel):
2828
domain: str
2929
available: bool | None = None
30-
checked_at: str = ""
3130
status: AvailabilityStatus
3231

3332

@@ -77,12 +76,10 @@ def _build_result(
7776
domain: str,
7877
status: AvailabilityStatus,
7978
available: bool | None = None,
80-
checked_at: str = "",
8179
) -> AvailabilityResult:
8280
return AvailabilityResult(
8381
domain=_normalize_domain(domain),
8482
available=available,
85-
checked_at=_normalize_text(checked_at),
8683
status=status,
8784
)
8885

@@ -91,7 +88,6 @@ def _build_cached_result(domain: str, cached_data: CachedData) -> AvailabilityRe
9188
return _build_result(
9289
domain=domain,
9390
available=_normalize_bool(cached_data.get("available")),
94-
checked_at=_normalize_text(cached_data.get("checked_at")),
9591
status="ok",
9692
)
9793

@@ -136,6 +132,5 @@ async def get_availability(
136132
return _build_result(
137133
current_domain,
138134
available=available,
139-
checked_at="",
140135
status="ok",
141136
)

gptkit-whois-openapi.json

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"openapi": "3.1.0",
33
"info": {
44
"title": "GPTKit Domain Availability API",
5-
"version": "3.0.0"
5+
"version": "4.0.0"
66
},
77
"servers": [
88
{
@@ -23,16 +23,12 @@
2323
"type": ["boolean", "null"],
2424
"description": "Availability when known, or null when the lookup was skipped or failed."
2525
},
26-
"checked_at": {
27-
"type": "string",
28-
"description": "UTC timestamp of the cached WHOIS check, empty string when unavailable."
29-
},
3026
"status": {
3127
"type": "string",
3228
"enum": ["ok", "invalid_domain", "rate_limited", "whois_error"]
3329
}
3430
},
35-
"required": ["domain", "available", "checked_at", "status"]
31+
"required": ["domain", "available", "status"]
3632
},
3733
"AvailabilityResponse": {
3834
"type": "object",
@@ -46,16 +42,12 @@
4642
"type": ["boolean", "null"],
4743
"description": "Availability when known, or null when the lookup failed."
4844
},
49-
"checked_at": {
50-
"type": "string",
51-
"description": "UTC timestamp of the cached WHOIS check, empty string when unavailable."
52-
},
5345
"status": {
5446
"type": "string",
5547
"enum": ["ok", "invalid_domain", "rate_limited", "whois_error"]
5648
}
5749
},
58-
"required": ["domain", "available", "checked_at", "status"]
50+
"required": ["domain", "available", "status"]
5951
},
6052
"ErrorResponse": {
6153
"type": "object",

tests/test_api.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ def test_availability_single_domain_success(client):
117117
assert result["domain"] == "example.com"
118118
assert result["available"] is False
119119
assert result["status"] == "ok"
120-
assert result["checked_at"]
121120
finally:
122121
domain.whois_service = original_service
123122

@@ -144,7 +143,6 @@ def test_availability_cache_hit_skips_live_lookup(client):
144143
assert result["domain"] == "cached.com"
145144
assert result["available"] is False
146145
assert result["status"] == "ok"
147-
assert result["checked_at"]
148146
assert mock_service.lookup_calls == []
149147
finally:
150148
domain.whois_service = original_service
@@ -164,7 +162,6 @@ def test_availability_invalid_domain_returns_stable_result(client):
164162
assert response.json() == {
165163
"domain": "invalid",
166164
"available": None,
167-
"checked_at": "",
168165
"status": "invalid_domain",
169166
}
170167
assert mock_service.lookup_calls == []
@@ -189,7 +186,6 @@ def test_availability_rate_limited_returns_stable_result(client):
189186
assert response.json() == {
190187
"domain": "one.com",
191188
"available": None,
192-
"checked_at": "",
193189
"status": "rate_limited",
194190
}
195191
finally:
@@ -208,7 +204,7 @@ def test_availability_response_does_not_expose_whois_details(client):
208204
assert response.status_code == 200
209205

210206
result = response.json()
211-
assert set(result.keys()) == {"domain", "available", "checked_at", "status"}
207+
assert set(result.keys()) == {"domain", "available", "status"}
212208
assert "raw" not in result
213209
assert "created_at" not in result
214210
assert "registrar" not in result

0 commit comments

Comments
 (0)