Skip to content

Commit 31fd86a

Browse files
committed
A more-correct implementation of the second approach
1 parent 91e9c64 commit 31fd86a

File tree

4 files changed

+108
-27
lines changed

4 files changed

+108
-27
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 31 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 53 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 12 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/ingest/_types/Database.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,27 @@
1919

2020
import { Id, Name } from '@_types/common'
2121

22-
/** The configuration necessary to identify which IP geolocation provider to use to download the database, as well as any provider-specific configuration necessary for such downloading.
22+
/** The configuration necessary to identify which IP geolocation provider to use to download a database, as well as any provider-specific configuration necessary for such downloading.
2323
* At present, the only supported providers are maxmind and ipinfo, and the maxmind provider requires that an account_id (string) is configured.
2424
* A provider (either maxmind or ipinfo) must be specified.
2525
*/
26-
export type DatabaseConfiguration = Maxmind | Ipinfo
26+
export type DatabaseConfiguration = MaxmindConfiguration | IpinfoConfiguration
2727

2828
export class DatabaseConfigurationBase {
2929
/** The provider-assigned name of the IP geolocation database to download. */
3030
name: Name
3131
}
3232

33-
export class Maxmind extends DatabaseConfigurationBase {
33+
export class Maxmind {
3434
account_id: Id
3535
}
3636

37-
export class Ipinfo extends DatabaseConfigurationBase {}
37+
export class MaxmindConfiguration extends DatabaseConfigurationBase {
38+
maxmind: Maxmind
39+
}
40+
41+
export class Ipinfo {}
42+
43+
export class IpinfoConfiguration extends DatabaseConfigurationBase {
44+
ipinfo: Ipinfo
45+
}

0 commit comments

Comments
 (0)