Skip to content

Support for Server-Sent-Events #4761

@tobiaskahl

Description

@tobiaskahl

If the Backend provides an API with Content-Type "application/stream+json" or "text/event-stream" swagger-ui should use an EventSource instead of sending ajax http-requests.

code:
var evtSource = new EventSource('http:server.domain.com/context_path)');
evtSource.onerror = function(e) {
console.log(e.data);
}
evtSource.onmessage = function(event) {
console.log(event.data);
}

instead of logging the data it should be displayed in the response field.

For IE-Support maybe it is necessary to include an polyfill.
e.g.: eventsource.js from https://github.com/Yaffle/EventSource/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions