SigSpec icon indicating copy to clipboard operation
SigSpec copied to clipboard

SigSpec UI

Open TomSmith27 opened this issue 4 years ago • 9 comments

The Start of a UI for SigSpec similar to swagger UI

Closes #7

Will fetch the SigSpec json from 'sigspsec/spec.json' and render a UI based on the data.

Features

  • Listen to callbacks
  • Send Operations
  • View the Definitions

Hubs

image

Each hub will try and connect on page load and display an indicator to show whether this was successful

Callbacks

image

This is an example of a callback, it allows you to start and stop listening to a callback, and while listening any incoming messages will appear in the black box with the timestamp and the parameters of the message.

Operations

image

Operations work very much like post requests in SwaggerUI and will allow to fill in the method parameters this can be either primitive types or objects

Definitions

image

This works the same as SwaggerUI

Open tasks

  • [x] Easy way to publish/update ui output into SigSpec.AspNetCore/SigSpecUI (also done in CI build before nuget build)
  • [x] Somehow we need to patch the index.html and inject options from the ui middleware (eg spec routes from registration documents), settings with Route and {documentName} placeholder (similar to json middleware)
  • [ ] Clone Template document in generator before populating it

TomSmith27 avatar May 21 '20 13:05 TomSmith27

@RicoSuter Would you be able to take a quick look at this, I have started to work on the SigSpecUI, just wanted to make sure i am heading down the correct track with this?

If you read the comments above you can see a list of Features that are currently implemented.

If you run the UI project you will also need to run the HelloSignalR example as that's where it gets the spec from, in time this will work as Middleware.

TomSmith27 avatar May 21 '20 13:05 TomSmith27

Lgtm

I see the following tasks:

  • [ ] Easy way to publish ui output into SigSpec.AspNetCore/SigSpecUI (also done in CI build before nuget build)
  • [ ] Somehow we need to patch the index.html and inject options from the ui middleware (eg spec urls)
  • [ ] In AspNetCore: Add AddSigSpecDocument (multiple allowed like in nswag) and provide these urls via options (ui should support multiple urls like swagger ui)

What do you think?

Very nice btw, i personally dont use SignalR much, so wont be able to contribute much.

RicoSuter avatar May 21 '20 23:05 RicoSuter

Btw, i’m not saying nswag is the way we should do it - there are many things which i would do differently internally but i dont have the tike to change it.. at least we should make the api as similar as possible.. please tell me if something doesnt make sense or could be simplified..

I’ve added some tasks to the issue, but we can also move them to separate gh issues..

RicoSuter avatar May 22 '20 21:05 RicoSuter

Cool thanks for taking a look i am hoping to get some more time to work on adding the features you mentioned such as injecting the settings into the html, and adding support for a JWT token. as the app i am working on requires one for the SignalR.

I haven't really looked at the NSwag code much so dont know if there is anything we need to do differently for this project,

TomSmith27 avatar May 23 '20 10:05 TomSmith27

Is there any update on this?

RicoSuter avatar Jun 11 '20 23:06 RicoSuter

Hey sorry, I have been busy with work, i will try resolve the code review comments today and add the authentication, then maybe it could be ready for an alpha release?

TomSmith27 avatar Jun 15 '20 08:06 TomSmith27

@RicoSuter @TomSmith27 any news on this?

seriouz avatar Aug 16 '20 15:08 seriouz

I am still planning to work on it, all that needs implementing now is a way to provide a token like normal swagger so will try and do that this week

TomSmith27 avatar Aug 24 '20 19:08 TomSmith27

a way to provide a token

What do you mean with that? Authentication?

RicoSuter avatar Aug 26 '20 21:08 RicoSuter