mirror of
https://github.com/google/nomulus.git
synced 2025-07-27 21:16:25 +02:00
Alphabetize YAML output by property name (#2128)
This makes printing the TLDs prettier and makes it easier to find fields.
This commit is contained in:
parent
f01adfb060
commit
7b59c4abbf
3 changed files with 93 additions and 89 deletions
|
@ -19,10 +19,12 @@ import static com.google.common.collect.Ordering.natural;
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
import com.fasterxml.jackson.core.JsonParser;
|
import com.fasterxml.jackson.core.JsonParser;
|
||||||
import com.fasterxml.jackson.databind.DeserializationContext;
|
import com.fasterxml.jackson.databind.DeserializationContext;
|
||||||
|
import com.fasterxml.jackson.databind.MapperFeature;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||||
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
|
||||||
|
import com.fasterxml.jackson.databind.json.JsonMapper;
|
||||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
||||||
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
|
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
|
||||||
|
@ -54,8 +56,10 @@ public class EntityYamlUtils {
|
||||||
module.addSerializer(Money.class, new MoneySerializer());
|
module.addSerializer(Money.class, new MoneySerializer());
|
||||||
module.addDeserializer(Money.class, new MoneyDeserializer());
|
module.addDeserializer(Money.class, new MoneyDeserializer());
|
||||||
ObjectMapper mapper =
|
ObjectMapper mapper =
|
||||||
new ObjectMapper(new YAMLFactory().disable(Feature.WRITE_DOC_START_MARKER))
|
JsonMapper.builder(new YAMLFactory().disable(Feature.WRITE_DOC_START_MARKER))
|
||||||
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
|
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
|
||||||
|
.enable(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY)
|
||||||
|
.build()
|
||||||
.registerModule(module);
|
.registerModule(module);
|
||||||
mapper.findAndRegisterModules();
|
mapper.findAndRegisterModules();
|
||||||
return mapper;
|
return mapper;
|
||||||
|
|
|
@ -1,59 +1,26 @@
|
||||||
tldStr: "tld"
|
|
||||||
roidSuffix: "TLD"
|
|
||||||
pricingEngineClassName: "google.registry.model.pricing.StaticPremiumListPricingEngine"
|
|
||||||
dnsWriters:
|
|
||||||
- "baz"
|
|
||||||
- "bang"
|
|
||||||
numDnsPublishLocks: 1
|
|
||||||
dnsAPlusAaaaTtl: 3600000
|
|
||||||
dnsNsTtl: null
|
|
||||||
dnsDsTtl: null
|
|
||||||
tldUnicode: "tld"
|
|
||||||
driveFolderId: null
|
|
||||||
tldType: "REAL"
|
|
||||||
invoicingEnabled: false
|
|
||||||
tldStateTransitions:
|
|
||||||
"1970-01-01T00:00:00.000Z": "GENERAL_AVAILABILITY"
|
|
||||||
creationTime: "1970-01-01T00:00:00.000Z"
|
|
||||||
reservedListNames: []
|
|
||||||
premiumListName: "tld"
|
|
||||||
escrowEnabled: false
|
|
||||||
dnsPaused: false
|
|
||||||
addGracePeriodLength: 432000000
|
addGracePeriodLength: 432000000
|
||||||
|
allowedFullyQualifiedHostNames:
|
||||||
|
- "foo"
|
||||||
|
allowedRegistrantContactIds: []
|
||||||
anchorTenantAddGracePeriodLength: 2592000000
|
anchorTenantAddGracePeriodLength: 2592000000
|
||||||
autoRenewGracePeriodLength: 3888000000
|
autoRenewGracePeriodLength: 3888000000
|
||||||
redemptionGracePeriodLength: 2592000000
|
|
||||||
renewGracePeriodLength: 432000000
|
|
||||||
transferGracePeriodLength: 432000000
|
|
||||||
automaticTransferLength: 432000000
|
automaticTransferLength: 432000000
|
||||||
pendingDeleteLength: 432000000
|
claimsPeriodEnd: "294247-01-10T04:00:54.775Z"
|
||||||
currency: "USD"
|
|
||||||
createBillingCost:
|
createBillingCost:
|
||||||
currency: "USD"
|
currency: "USD"
|
||||||
amount: 13.00
|
amount: 13.00
|
||||||
restoreBillingCost:
|
creationTime: "1970-01-01T00:00:00.000Z"
|
||||||
currency: "USD"
|
currency: "USD"
|
||||||
amount: 17.00
|
|
||||||
serverStatusChangeBillingCost:
|
|
||||||
currency: "USD"
|
|
||||||
amount: 19.00
|
|
||||||
registryLockOrUnlockBillingCost:
|
|
||||||
currency: "USD"
|
|
||||||
amount: 0.00
|
|
||||||
renewBillingCostTransitions:
|
|
||||||
"1970-01-01T00:00:00.000Z":
|
|
||||||
currency: "USD"
|
|
||||||
amount: 11.00
|
|
||||||
lordnUsername: null
|
|
||||||
claimsPeriodEnd: "294247-01-10T04:00:54.775Z"
|
|
||||||
allowedRegistrantContactIds: []
|
|
||||||
allowedFullyQualifiedHostNames:
|
|
||||||
- "foo"
|
|
||||||
defaultPromoTokens:
|
defaultPromoTokens:
|
||||||
- "bbbbb"
|
- "bbbbb"
|
||||||
idnTables:
|
dnsAPlusAaaaTtl: 3600000
|
||||||
- "JA"
|
dnsDsTtl: null
|
||||||
- "EXTENDED_LATIN"
|
dnsNsTtl: null
|
||||||
|
dnsPaused: false
|
||||||
|
dnsWriters:
|
||||||
|
- "baz"
|
||||||
|
- "bang"
|
||||||
|
driveFolderId: null
|
||||||
eapFeeSchedule:
|
eapFeeSchedule:
|
||||||
"1970-01-01T00:00:00.000Z":
|
"1970-01-01T00:00:00.000Z":
|
||||||
currency: "USD"
|
currency: "USD"
|
||||||
|
@ -64,3 +31,36 @@ eapFeeSchedule:
|
||||||
"2000-06-02T00:00:00.000Z":
|
"2000-06-02T00:00:00.000Z":
|
||||||
currency: "USD"
|
currency: "USD"
|
||||||
amount: 0.00
|
amount: 0.00
|
||||||
|
escrowEnabled: false
|
||||||
|
idnTables:
|
||||||
|
- "JA"
|
||||||
|
- "EXTENDED_LATIN"
|
||||||
|
invoicingEnabled: false
|
||||||
|
lordnUsername: null
|
||||||
|
numDnsPublishLocks: 1
|
||||||
|
pendingDeleteLength: 432000000
|
||||||
|
premiumListName: "tld"
|
||||||
|
pricingEngineClassName: "google.registry.model.pricing.StaticPremiumListPricingEngine"
|
||||||
|
redemptionGracePeriodLength: 2592000000
|
||||||
|
registryLockOrUnlockBillingCost:
|
||||||
|
currency: "USD"
|
||||||
|
amount: 0.00
|
||||||
|
renewBillingCostTransitions:
|
||||||
|
"1970-01-01T00:00:00.000Z":
|
||||||
|
currency: "USD"
|
||||||
|
amount: 11.00
|
||||||
|
renewGracePeriodLength: 432000000
|
||||||
|
reservedListNames: []
|
||||||
|
restoreBillingCost:
|
||||||
|
currency: "USD"
|
||||||
|
amount: 17.00
|
||||||
|
roidSuffix: "TLD"
|
||||||
|
serverStatusChangeBillingCost:
|
||||||
|
currency: "USD"
|
||||||
|
amount: 19.00
|
||||||
|
tldStateTransitions:
|
||||||
|
"1970-01-01T00:00:00.000Z": "GENERAL_AVAILABILITY"
|
||||||
|
tldStr: "tld"
|
||||||
|
tldType: "REAL"
|
||||||
|
tldUnicode: "tld"
|
||||||
|
transferGracePeriodLength: 432000000
|
||||||
|
|
|
@ -1,41 +1,36 @@
|
||||||
tldStr: "xn--q9jyb4c"
|
|
||||||
roidSuffix: "Q9JYB4C"
|
|
||||||
pricingEngineClassName: "google.registry.model.pricing.StaticPremiumListPricingEngine"
|
|
||||||
dnsWriters:
|
|
||||||
- "VoidDnsWriter"
|
|
||||||
numDnsPublishLocks: 1
|
|
||||||
dnsAPlusAaaaTtl: null
|
|
||||||
dnsNsTtl: null
|
|
||||||
dnsDsTtl: null
|
|
||||||
tldUnicode: "みんな"
|
|
||||||
driveFolderId: null
|
|
||||||
tldType: "REAL"
|
|
||||||
invoicingEnabled: false
|
|
||||||
tldStateTransitions:
|
|
||||||
"1970-01-01T00:00:00.000Z": "GENERAL_AVAILABILITY"
|
|
||||||
creationTime: "2022-09-01T00:00:00.000Z"
|
|
||||||
reservedListNames: []
|
|
||||||
premiumListName: "xn--q9jyb4c"
|
|
||||||
escrowEnabled: false
|
|
||||||
dnsPaused: false
|
|
||||||
addGracePeriodLength: 432000000
|
addGracePeriodLength: 432000000
|
||||||
|
allowedFullyQualifiedHostNames: []
|
||||||
|
allowedRegistrantContactIds: []
|
||||||
anchorTenantAddGracePeriodLength: 2592000000
|
anchorTenantAddGracePeriodLength: 2592000000
|
||||||
autoRenewGracePeriodLength: 3888000000
|
autoRenewGracePeriodLength: 3888000000
|
||||||
redemptionGracePeriodLength: 2592000000
|
|
||||||
renewGracePeriodLength: 432000000
|
|
||||||
transferGracePeriodLength: 432000000
|
|
||||||
automaticTransferLength: 432000000
|
automaticTransferLength: 432000000
|
||||||
pendingDeleteLength: 432000000
|
claimsPeriodEnd: "294247-01-10T04:00:54.775Z"
|
||||||
currency: "USD"
|
|
||||||
createBillingCost:
|
createBillingCost:
|
||||||
currency: "USD"
|
currency: "USD"
|
||||||
amount: 13.00
|
amount: 13.00
|
||||||
restoreBillingCost:
|
creationTime: "2022-09-01T00:00:00.000Z"
|
||||||
|
currency: "USD"
|
||||||
|
defaultPromoTokens: []
|
||||||
|
dnsAPlusAaaaTtl: null
|
||||||
|
dnsDsTtl: null
|
||||||
|
dnsNsTtl: null
|
||||||
|
dnsPaused: false
|
||||||
|
dnsWriters:
|
||||||
|
- "VoidDnsWriter"
|
||||||
|
driveFolderId: null
|
||||||
|
eapFeeSchedule:
|
||||||
|
"1970-01-01T00:00:00.000Z":
|
||||||
currency: "USD"
|
currency: "USD"
|
||||||
amount: 17.00
|
amount: 0.00
|
||||||
serverStatusChangeBillingCost:
|
escrowEnabled: false
|
||||||
currency: "USD"
|
idnTables: []
|
||||||
amount: 19.00
|
invoicingEnabled: false
|
||||||
|
lordnUsername: null
|
||||||
|
numDnsPublishLocks: 1
|
||||||
|
pendingDeleteLength: 432000000
|
||||||
|
premiumListName: "xn--q9jyb4c"
|
||||||
|
pricingEngineClassName: "google.registry.model.pricing.StaticPremiumListPricingEngine"
|
||||||
|
redemptionGracePeriodLength: 2592000000
|
||||||
registryLockOrUnlockBillingCost:
|
registryLockOrUnlockBillingCost:
|
||||||
currency: "USD"
|
currency: "USD"
|
||||||
amount: 0.00
|
amount: 0.00
|
||||||
|
@ -43,13 +38,18 @@ renewBillingCostTransitions:
|
||||||
"1970-01-01T00:00:00.000Z":
|
"1970-01-01T00:00:00.000Z":
|
||||||
currency: "USD"
|
currency: "USD"
|
||||||
amount: 11.00
|
amount: 11.00
|
||||||
lordnUsername: null
|
renewGracePeriodLength: 432000000
|
||||||
claimsPeriodEnd: "294247-01-10T04:00:54.775Z"
|
reservedListNames: []
|
||||||
allowedRegistrantContactIds: []
|
restoreBillingCost:
|
||||||
allowedFullyQualifiedHostNames: []
|
|
||||||
defaultPromoTokens: []
|
|
||||||
idnTables: []
|
|
||||||
eapFeeSchedule:
|
|
||||||
"1970-01-01T00:00:00.000Z":
|
|
||||||
currency: "USD"
|
currency: "USD"
|
||||||
amount: 0.00
|
amount: 17.00
|
||||||
|
roidSuffix: "Q9JYB4C"
|
||||||
|
serverStatusChangeBillingCost:
|
||||||
|
currency: "USD"
|
||||||
|
amount: 19.00
|
||||||
|
tldStateTransitions:
|
||||||
|
"1970-01-01T00:00:00.000Z": "GENERAL_AVAILABILITY"
|
||||||
|
tldStr: "xn--q9jyb4c"
|
||||||
|
tldType: "REAL"
|
||||||
|
tldUnicode: "みんな"
|
||||||
|
transferGracePeriodLength: 432000000
|
Loading…
Add table
Add a link
Reference in a new issue