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

fix: add endpoints accessing datamodel schema to sync endpoints #14427

Merged
merged 6 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -138,23 +138,7 @@

Guard.AssertFilePathWithinParentDirectory(RepositoryDirectory, absoluteFilePath);

// In some weird cases these two alternate ways of reading a file sometimes works while the other fails.
// Experienced in both 0678.xsd in ttd-datamodels and resource.en.json in hvem-er-hvem.
// Opening the file in an editor and saving it resolved the issue for 0678.xsd. Is most likely related to BOM
// and that the BOM bytes isn't removed on read in the ReadTextAsync method.
// Should try to fix this as this method is more performant than ReadAllTextAsync.
// return await ReadTextAsync(absoluteFilePath)
try
{
File.SetAttributes(absoluteFilePath, FileAttributes.Normal);
return await File.ReadAllTextAsync(absoluteFilePath, Encoding.UTF8, cancellationToken);
}
catch (IOException)
{
Thread.Sleep(1000);
File.SetAttributes(absoluteFilePath, FileAttributes.Normal);
return await File.ReadAllTextAsync(absoluteFilePath, Encoding.UTF8, cancellationToken);
}
return await File.ReadAllTextAsync(absoluteFilePath, Encoding.UTF8, cancellationToken);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ public class EndpointNameSyncEvaluator : IRequestSyncEvaluator
{
TrimmedControllerName(nameof(AppDevelopmentController)),
GenerateFrozenSet(
nameof(AppDevelopmentController.AddLayoutSet),
nameof(AppDevelopmentController.DeleteFormLayout),
nameof(AppDevelopmentController.DeleteLayoutSet),
nameof(AppDevelopmentController.GetModelMetadata),
nameof(AppDevelopmentController.SaveFormLayout),
nameof(AppDevelopmentController.UpdateFormLayoutName),
nameof(AppDevelopmentController.SaveLayoutSettings),
nameof(AppDevelopmentController.SaveRuleHandler),
nameof(AppDevelopmentController.SaveRuleConfig),
nameof(AppDevelopmentController.AddLayoutSet),
nameof(AppDevelopmentController.UpdateLayoutSetName),
nameof(AppDevelopmentController.DeleteFormLayout),
nameof(AppDevelopmentController.DeleteLayoutSet)
nameof(AppDevelopmentController.SaveRuleHandler),
nameof(AppDevelopmentController.UpdateFormLayoutName),
nameof(AppDevelopmentController.UpdateLayoutSetName)
)
},
{
Expand Down Expand Up @@ -75,6 +76,18 @@ public class EndpointNameSyncEvaluator : IRequestSyncEvaluator
GenerateFrozenSet(
nameof(DeploymentsController.Create)
)
},
{
TrimmedControllerName(nameof(DatamodelsController)),
GenerateFrozenSet(
nameof(DatamodelsController.Get)
)
},
{
TrimmedControllerName(nameof(PreviewController)),
GenerateFrozenSet(
nameof(PreviewController.Datamodel)
)
}
}.ToFrozenDictionary();

Expand Down
Loading