RicoSuter / SigSpec

Specification and code generator for SignalR Core.
MIT License
159 stars 37 forks source link

SigSpec UI #35

Open TomSmith27 opened 4 years ago

TomSmith27 commented 4 years ago

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

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

TomSmith27 commented 4 years ago

@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.

RicoSuter commented 4 years ago

Lgtm

I see the following tasks:

What do you think?

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

RicoSuter commented 4 years ago

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..

TomSmith27 commented 4 years ago

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,

RicoSuter commented 4 years ago

Is there any update on this?

TomSmith27 commented 4 years ago

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?

seriouz commented 4 years ago

@RicoSuter @TomSmith27 any news on this?

TomSmith27 commented 4 years ago

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

RicoSuter commented 4 years ago

a way to provide a token

What do you mean with that? Authentication?