Add pseudoboots and model validation
This commit is contained in:
@@ -87,6 +87,9 @@
|
||||
[RequiredSetting([Apr2025], PrizeShuffle.Vanilla)]
|
||||
[NoSettingName([Apr2025])]
|
||||
public PrizeShuffle PrizeShuffle { get; set; } = PrizeShuffle.Vanilla;
|
||||
|
||||
[NoSettingName]
|
||||
public BootsSettings StartingBoots { get; set; } = BootsSettings.None;
|
||||
}
|
||||
|
||||
public enum RandomizerInstance {
|
||||
@@ -211,4 +214,9 @@
|
||||
Nearby,
|
||||
Wild,
|
||||
}
|
||||
|
||||
public enum BootsSettings {
|
||||
None,
|
||||
[AdditionalSetting("--pseudoboots")] Pseudoboots,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,8 @@
|
||||
});
|
||||
});
|
||||
|
||||
builder.Services.AddControllers().AddJsonOptions(x => {
|
||||
builder.Services.AddControllers()
|
||||
.AddJsonOptions(x => {
|
||||
x.JsonSerializerOptions.PropertyNameCaseInsensitive = true;
|
||||
x.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.SnakeCaseLower;
|
||||
x.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter(JsonNamingPolicy.SnakeCaseLower, false));
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
[Route("/generate")]
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> Generate([FromBody] SeedSettings settings) {
|
||||
if (!ModelState.IsValid) {
|
||||
return BadRequest(ModelState);
|
||||
}
|
||||
try {
|
||||
var id = await this.RandomizeService.RandomizeSeed(settings);
|
||||
var url = string.Format("/seed/{0}", id);
|
||||
|
||||
Reference in New Issue
Block a user