Skip to content

Commit ecbd583

Browse files
Merge branch 'develop1.0'
2 parents 2d0c47f + b768ca1 commit ecbd583

6 files changed

Lines changed: 137 additions & 85 deletions

File tree

ASCOM.Alpaca.Razor/StartupHelpers.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ public static void ConfigureSwagger(IServiceCollection services, string host_xml
3232
//This is off for now
3333
//c.UseOneOfForPolymorphism();
3434

35-
c.SwaggerDoc("Alpaca", new OpenApiInfo { Title = $"{DeviceManager.Configuration.ServerName}", Description = "Please note that the Alpaca API documentation on the ASCOM website is the canonical version. There are several issues with this auto generated version that will be resolved in future versions. This is currently provided only for testing..", Version = "v1" });
36-
c.SwaggerDoc("OmniSim", new OpenApiInfo { Title = "OmniSim Setup", Version = "v1" });
35+
c.SwaggerDoc("Alpaca", new OpenApiInfo { Title = $"{DeviceManager.Configuration.ServerName}", Description = "The Alpaca JSON API Specification. You can find the Alpaca HTML Specification and the OmniSim only configuration specification in the drop down. Please note that the Alpaca API documentation on the ASCOM website is the canonical version. There are several issues with this auto generated version that will be resolved in future versions. This is currently provided only for testing.", Version = "v1" });
36+
c.SwaggerDoc("AlpacaSetup", new OpenApiInfo { Title = $"{DeviceManager.Configuration.ServerName}", Description = "Alpaca HTML Setup API - These are used to give the end user a GUI to configure device specific settings.", Version = "v1" });
37+
c.SwaggerDoc("OmniSim", new OpenApiInfo { Title = "OmniSim JSON API", Description="API configuration that is unique to the OmniSim. These are not part of the Alpaca Spec but are helpful to automate testing with the OmniSim.", Version = "v1" });
3738

3839

3940
if (File.Exists(host_xml_file))
@@ -81,7 +82,9 @@ public static void ConfigureSwagger(IApplicationBuilder app)
8182
app.UseSwagger();
8283
app.UseSwaggerUI(c => {
8384
c.SwaggerEndpoint("/swagger/Alpaca/swagger.json",
84-
$"Alpaca Endpoints - v1");
85+
$"Alpaca JSON Endpoints - v1");
86+
c.SwaggerEndpoint("/swagger/AlpacaSetup/swagger.json",
87+
$"Alpaca HTML Endpoints - v1");
8588
c.SwaggerEndpoint("/swagger/OmniSim/swagger.json", "OmniSim Only Endpoints");
8689
c.DocExpansion(DocExpansion.None);
8790
});

ASCOM.Alpaca.Simulators/Controllers/FilterWheelSettingsController.cs

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ namespace ASCOM.Alpaca.Simulators
1717
[ServiceFilter(typeof(AuthorizationFilter))]
1818
[ApiController]
1919
[Route("simulator/v1/")]
20-
public class FilterWheelSettingsController : ProcessBaseController
21-
{
20+
public class FilterWheelSettingsController : ProcessBaseController
21+
{
2222
/// <summary>
2323
/// OmniSim Only - Time to move between filter positions (milliseconds)
2424
/// </summary>
@@ -33,7 +33,8 @@ public class FilterWheelSettingsController : ProcessBaseController
3333
/// <response code="500" examples="Error message describing why the command cannot be processed">Server internal error, check error message</response>
3434
[HttpGet]
3535
[Produces(MediaTypeNames.Application.Json)]
36-
[ApiExplorerSettings(GroupName = "OmniSim")] [Route("filterwheel/{DeviceNumber}/filterchangetimeinterval")]
36+
[ApiExplorerSettings(GroupName = "OmniSim")]
37+
[Route("filterwheel/{DeviceNumber}/filterchangetimeinterval")]
3738
public ActionResult<ASCOM.Common.Alpaca.IntResponse> FilterChangeTimeInterval(
3839
[Required][DefaultValue(0)][SwaggerSchema(Strings.DeviceIDDescription, Format = "uint32")][Range(0, 4294967295)] uint DeviceNumber,
3940
[SwaggerSchema(Strings.ClientIDDescription, Format = "uint32")][Range(0, 4294967295)] uint ClientID = 0,
@@ -56,7 +57,8 @@ public class FilterWheelSettingsController : ProcessBaseController
5657
/// <response code="500" examples="Error message describing why the command cannot be processed">Server internal error, check error message</response>
5758
[HttpPut]
5859
[Produces(MediaTypeNames.Application.Json)]
59-
[ApiExplorerSettings(GroupName = "OmniSim")] [Route("filterwheel/{DeviceNumber}/filterchangetimeinterval")]
60+
[ApiExplorerSettings(GroupName = "OmniSim")]
61+
[Route("filterwheel/{DeviceNumber}/filterchangetimeinterval")]
6062
public ActionResult<Response> FilterChangeTimeInterval(
6163
[Required][DefaultValue(0)][SwaggerSchema(Strings.DeviceIDDescription, Format = "uint32")][Range(0, 4294967295)] uint DeviceNumber,
6264
[Required][FromForm][SwaggerSchema("Time to move between filter positions (milliseconds)")] System.Int32 FilterChangeTimeInterval,
@@ -79,7 +81,8 @@ public ActionResult<Response> FilterChangeTimeInterval(
7981
/// <response code="500" examples="Error message describing why the command cannot be processed">Server internal error, check error message</response>
8082
[HttpGet]
8183
[Produces(MediaTypeNames.Application.Json)]
82-
[ApiExplorerSettings(GroupName = "OmniSim")] [Route("filterwheel/{DeviceNumber}/implementsnames")]
84+
[ApiExplorerSettings(GroupName = "OmniSim")]
85+
[Route("filterwheel/{DeviceNumber}/implementsnames")]
8386
public ActionResult<ASCOM.Common.Alpaca.BoolResponse> ImplementsNames(
8487
[Required][DefaultValue(0)][SwaggerSchema(Strings.DeviceIDDescription, Format = "uint32")][Range(0, 4294967295)] uint DeviceNumber,
8588
[SwaggerSchema(Strings.ClientIDDescription, Format = "uint32")][Range(0, 4294967295)] uint ClientID = 0,
@@ -102,7 +105,8 @@ public ActionResult<Response> FilterChangeTimeInterval(
102105
/// <response code="500" examples="Error message describing why the command cannot be processed">Server internal error, check error message</response>
103106
[HttpPut]
104107
[Produces(MediaTypeNames.Application.Json)]
105-
[ApiExplorerSettings(GroupName = "OmniSim")] [Route("filterwheel/{DeviceNumber}/implementsnames")]
108+
[ApiExplorerSettings(GroupName = "OmniSim")]
109+
[Route("filterwheel/{DeviceNumber}/implementsnames")]
106110
public ActionResult<Response> ImplementsNames(
107111
[Required][DefaultValue(0)][SwaggerSchema(Strings.DeviceIDDescription, Format = "uint32")][Range(0, 4294967295)] uint DeviceNumber,
108112
[Required][FromForm][SwaggerSchema("True if the driver implements names")] System.Boolean ImplementsNames,
@@ -125,7 +129,8 @@ public ActionResult<Response> ImplementsNames(
125129
/// <response code="500" examples="Error message describing why the command cannot be processed">Server internal error, check error message</response>
126130
[HttpGet]
127131
[Produces(MediaTypeNames.Application.Json)]
128-
[ApiExplorerSettings(GroupName = "OmniSim")] [Route("filterwheel/{DeviceNumber}/implementsoffsets")]
132+
[ApiExplorerSettings(GroupName = "OmniSim")]
133+
[Route("filterwheel/{DeviceNumber}/implementsoffsets")]
129134
public ActionResult<ASCOM.Common.Alpaca.BoolResponse> ImplementsOffsets(
130135
[Required][DefaultValue(0)][SwaggerSchema(Strings.DeviceIDDescription, Format = "uint32")][Range(0, 4294967295)] uint DeviceNumber,
131136
[SwaggerSchema(Strings.ClientIDDescription, Format = "uint32")][Range(0, 4294967295)] uint ClientID = 0,
@@ -148,7 +153,8 @@ public ActionResult<Response> ImplementsNames(
148153
/// <response code="500" examples="Error message describing why the command cannot be processed">Server internal error, check error message</response>
149154
[HttpPut]
150155
[Produces(MediaTypeNames.Application.Json)]
151-
[ApiExplorerSettings(GroupName = "OmniSim")] [Route("filterwheel/{DeviceNumber}/implementsoffsets")]
156+
[ApiExplorerSettings(GroupName = "OmniSim")]
157+
[Route("filterwheel/{DeviceNumber}/implementsoffsets")]
152158
public ActionResult<Response> ImplementsOffsets(
153159
[Required][DefaultValue(0)][SwaggerSchema(Strings.DeviceIDDescription, Format = "uint32")][Range(0, 4294967295)] uint DeviceNumber,
154160
[Required][FromForm][SwaggerSchema("True if the driver implements offsets")] System.Boolean ImplementsOffsets,
@@ -171,7 +177,8 @@ public ActionResult<Response> ImplementsOffsets(
171177
/// <response code="500" examples="Error message describing why the command cannot be processed">Server internal error, check error message</response>
172178
[HttpGet]
173179
[Produces(MediaTypeNames.Application.Json)]
174-
[ApiExplorerSettings(GroupName = "OmniSim")] [Route("filterwheel/{DeviceNumber}/preemptmoves")]
180+
[ApiExplorerSettings(GroupName = "OmniSim")]
181+
[Route("filterwheel/{DeviceNumber}/preemptmoves")]
175182
public ActionResult<ASCOM.Common.Alpaca.BoolResponse> PreemptMoves(
176183
[Required][DefaultValue(0)][SwaggerSchema(Strings.DeviceIDDescription, Format = "uint32")][Range(0, 4294967295)] uint DeviceNumber,
177184
[SwaggerSchema(Strings.ClientIDDescription, Format = "uint32")][Range(0, 4294967295)] uint ClientID = 0,
@@ -194,7 +201,8 @@ public ActionResult<Response> ImplementsOffsets(
194201
/// <response code="500" examples="Error message describing why the command cannot be processed">Server internal error, check error message</response>
195202
[HttpPut]
196203
[Produces(MediaTypeNames.Application.Json)]
197-
[ApiExplorerSettings(GroupName = "OmniSim")] [Route("filterwheel/{DeviceNumber}/preemptmoves")]
204+
[ApiExplorerSettings(GroupName = "OmniSim")]
205+
[Route("filterwheel/{DeviceNumber}/preemptmoves")]
198206
public ActionResult<Response> PreemptMoves(
199207
[Required][DefaultValue(0)][SwaggerSchema(Strings.DeviceIDDescription, Format = "uint32")][Range(0, 4294967295)] uint DeviceNumber,
200208
[Required][FromForm][SwaggerSchema("True if the driver can interrupt moves")] System.Boolean PreemptMoves,
@@ -217,7 +225,8 @@ public ActionResult<Response> PreemptMoves(
217225
/// <response code="500" examples="Error message describing why the command cannot be processed">Server internal error, check error message</response>
218226
[HttpGet]
219227
[Produces(MediaTypeNames.Application.Json)]
220-
[ApiExplorerSettings(GroupName = "OmniSim")] [Route("filterwheel/{DeviceNumber}/slots")]
228+
[ApiExplorerSettings(GroupName = "OmniSim")]
229+
[Route("filterwheel/{DeviceNumber}/slots")]
221230
public ActionResult<ASCOM.Common.Alpaca.IntResponse> Slots(
222231
[Required][DefaultValue(0)][SwaggerSchema(Strings.DeviceIDDescription, Format = "uint32")][Range(0, 4294967295)] uint DeviceNumber,
223232
[SwaggerSchema(Strings.ClientIDDescription, Format = "uint32")][Range(0, 4294967295)] uint ClientID = 0,
@@ -240,7 +249,8 @@ public ActionResult<Response> PreemptMoves(
240249
/// <response code="500" examples="Error message describing why the command cannot be processed">Server internal error, check error message</response>
241250
[HttpPut]
242251
[Produces(MediaTypeNames.Application.Json)]
243-
[ApiExplorerSettings(GroupName = "OmniSim")] [Route("filterwheel/{DeviceNumber}/slots")]
252+
[ApiExplorerSettings(GroupName = "OmniSim")]
253+
[Route("filterwheel/{DeviceNumber}/slots")]
244254
public ActionResult<Response> Slots(
245255
[Required][DefaultValue(0)][SwaggerSchema(Strings.DeviceIDDescription, Format = "uint32")][Range(0, 4294967295)] uint DeviceNumber,
246256
[Required][FromForm][SwaggerSchema("Number of filter wheel positions, 1-8")] System.Int32 Slots,
@@ -263,7 +273,8 @@ public ActionResult<Response> Slots(
263273
/// <response code="500" examples="Error message describing why the command cannot be processed">Server internal error, check error message</response>
264274
[HttpGet]
265275
[Produces(MediaTypeNames.Application.Json)]
266-
[ApiExplorerSettings(GroupName = "OmniSim")] [Route("filterwheel/{DeviceNumber}/interfaceversion")]
276+
[ApiExplorerSettings(GroupName = "OmniSim")]
277+
[Route("filterwheel/{DeviceNumber}/interfaceversion")]
267278
public ActionResult<ASCOM.Common.Alpaca.IntResponse> InterfaceVersion(
268279
[Required][DefaultValue(0)][SwaggerSchema(Strings.DeviceIDDescription, Format = "uint32")][Range(0, 4294967295)] uint DeviceNumber,
269280
[SwaggerSchema(Strings.ClientIDDescription, Format = "uint32")][Range(0, 4294967295)] uint ClientID = 0,
@@ -286,7 +297,8 @@ public ActionResult<Response> Slots(
286297
/// <response code="500" examples="Error message describing why the command cannot be processed">Server internal error, check error message</response>
287298
[HttpPut]
288299
[Produces(MediaTypeNames.Application.Json)]
289-
[ApiExplorerSettings(GroupName = "OmniSim")] [Route("filterwheel/{DeviceNumber}/interfaceversion")]
300+
[ApiExplorerSettings(GroupName = "OmniSim")]
301+
[Route("filterwheel/{DeviceNumber}/interfaceversion")]
290302
public ActionResult<Response> InterfaceVersion(
291303
[Required][DefaultValue(0)][SwaggerSchema(Strings.DeviceIDDescription, Format = "uint32")][Range(0, 4294967295)] uint DeviceNumber,
292304
[Required][FromForm][SwaggerSchema("The ASCOM Interface Version, allowed values are 1-3")] System.Int16 InterfaceVersion,

0 commit comments

Comments
 (0)