diff --git a/backend/src/Designer/Controllers/AppDevelopmentController.cs b/backend/src/Designer/Controllers/AppDevelopmentController.cs index 5f8d9e884ca..66ff85a92e8 100644 --- a/backend/src/Designer/Controllers/AppDevelopmentController.cs +++ b/backend/src/Designer/Controllers/AppDevelopmentController.cs @@ -25,6 +25,7 @@ namespace Altinn.Studio.Designer.Controllers /// Controller containing actions that concerns app-development /// [Authorize] + [ApiController] [AutoValidateAntiforgeryToken] [Route("designer/api/{org}/{app:regex(^(?!datamodels$)[[a-z]][[a-z0-9-]]{{1,28}}[[a-z0-9]]$)}/app-development")] public class AppDevelopmentController : Controller @@ -57,6 +58,7 @@ public AppDevelopmentController(IAppDevelopmentService appDevelopmentService, IR /// Default action for the designer. /// /// default view for the app builder. + [HttpGet] [Route("/editor/{org}/{app:regex(^[[a-z]]+[[a-zA-Z0-9-]]+[[a-zA-Z0-9]]$)}/{*AllValues}")] public async Task Index(string org, string app) { diff --git a/backend/src/Designer/Controllers/ConfigController.cs b/backend/src/Designer/Controllers/ConfigController.cs index 2ae7f2bec4f..a848e1c16f7 100644 --- a/backend/src/Designer/Controllers/ConfigController.cs +++ b/backend/src/Designer/Controllers/ConfigController.cs @@ -13,6 +13,7 @@ namespace Altinn.Studio.Designer.Controllers /// /// Controller exposing endpoints that handle metadata in config.json /// + [ApiController] [Authorize] [AutoValidateAntiforgeryToken] [Route("designer/api/{org}/{app:regex(^(?!datamodels$)[[a-z]][[a-z0-9-]]{{1,28}}[[a-z0-9]]$)}/config")] diff --git a/backend/src/Designer/Controllers/DatamodelsController.cs b/backend/src/Designer/Controllers/DatamodelsController.cs index 12e8874da6d..e6b0f444456 100644 --- a/backend/src/Designer/Controllers/DatamodelsController.cs +++ b/backend/src/Designer/Controllers/DatamodelsController.cs @@ -24,6 +24,7 @@ namespace Altinn.Studio.Designer.Controllers /// /// Controller containing all actions related to data modelling /// + [ApiController] [Authorize] [AutoValidateAntiforgeryToken] [Route("designer/api/{org}/{repository:regex(^(?!datamodels$)[[a-z]][[a-z0-9-]]{{1,28}}[[a-z0-9]]$)}/datamodels")] diff --git a/backend/src/Designer/Controllers/EnvironmentsController.cs b/backend/src/Designer/Controllers/EnvironmentsController.cs index 44824cfc939..5725a0b71fa 100644 --- a/backend/src/Designer/Controllers/EnvironmentsController.cs +++ b/backend/src/Designer/Controllers/EnvironmentsController.cs @@ -11,6 +11,7 @@ namespace Altinn.Studio.Designer.Controllers /// /// This is the API controller for functionality related to environments. /// + [ApiController] [Authorize] [AutoValidateAntiforgeryToken] diff --git a/backend/src/Designer/Controllers/FeedbackFormController.cs b/backend/src/Designer/Controllers/FeedbackFormController.cs index cfe76ff6f9b..c09fcea166b 100644 --- a/backend/src/Designer/Controllers/FeedbackFormController.cs +++ b/backend/src/Designer/Controllers/FeedbackFormController.cs @@ -6,7 +6,6 @@ using Altinn.Studio.Designer.TypedHttpClients.Slack; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Routing; namespace Altinn.Studio.Designer.Controllers; diff --git a/backend/src/Designer/Controllers/HomeController.cs b/backend/src/Designer/Controllers/HomeController.cs index ab62df21501..75c817d8c34 100644 --- a/backend/src/Designer/Controllers/HomeController.cs +++ b/backend/src/Designer/Controllers/HomeController.cs @@ -16,6 +16,8 @@ namespace Altinn.Studio.Designer.Controllers /// /// The default MVC controller in the application /// + [ApiController] + [ApiExplorerSettings(IgnoreApi = true)] [Route("[action]/{id?}")] [Route("[controller]/[action]/{id?}")] public class HomeController : Controller diff --git a/backend/src/Designer/Controllers/ImageController.cs b/backend/src/Designer/Controllers/ImageController.cs index fbbd9a24fd5..a7597ce168a 100644 --- a/backend/src/Designer/Controllers/ImageController.cs +++ b/backend/src/Designer/Controllers/ImageController.cs @@ -19,6 +19,7 @@ namespace Altinn.Studio.Designer.Controllers; /// /// Controller containing actions related to images /// +[ApiController] [Authorize] [AutoValidateAntiforgeryToken] [Route("designer/api/{org}/{app:regex(^(?!datamodels$)[[a-z]][[a-z0-9-]]{{1,28}}[[a-z0-9]]$)}/images")] diff --git a/backend/src/Designer/Controllers/OptionsController.cs b/backend/src/Designer/Controllers/OptionsController.cs index 56f23452ce0..4bbd2a4463c 100644 --- a/backend/src/Designer/Controllers/OptionsController.cs +++ b/backend/src/Designer/Controllers/OptionsController.cs @@ -161,7 +161,7 @@ public async Task>> GetOptionListsRe [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [Route("{optionsListId}")] - public async Task>>> CreateOrOverwriteOptionsList(string org, string repo, [FromRoute] string optionsListId, [FromBody] List