Documentation Missing
See original GitHub issueQ | A |
---|---|
Bug or feature request? | Feature |
Which Swagger/OpenAPI version? | 3.x |
Which Swagger-Editor version? | 3.1.4 |
How did you install Swagger-Editor? | npm i swagger-editor-dist |
Which broswer & version? | Chrome |
Which operating system? | MacOS |
There are no docs for the editor API, which makes using it very difficult. Even a basic example of how to mount the editor with an existing spec would go a long way. In lieu of those, I have a couple questions:
How do you start the editor with a spec using a URL?(README says this is missing)- How do you start the editor with a spec in memory?
- How do you listen/subscribe/hook changes to the editor’s value (the current spec)?
- How do you set the editors value?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Missing Document Definition | Law Insider
Missing Document means a document required as part of the Application that is either not included in the application and/or not executed and...
Read more >Useful Strategies To Prevent Missing Medical Documentation
Missing medical documentation is a serious issue because it can compromise patient care, harm the healthcare provider's credibility, ...
Read more >What does missing documentation mean? - Packlink PRO
If you see the status Missing documentation as the last tracking update for your shipment, it means that your goods can't be dispatched...
Read more >What's missing from your company documentation? Context
Company documentation comes in many forms — how-to's, to-do's, shared knowledge, process docs, and more. Often, it gets a bad rep as being...
Read more >Denial Incorrect: Missing Documentation - daisyBill
When the EOR you receive from the claims administrator incorrectly cites missing documentation, we recommend language similar to the Second Review reason in ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Well I managed to figure out some of those out on my own. This is the wrapper I came up with.
@tyrsius, my apologies for dropping the ball here - this was mistakenly not tagged as a
Support
ticket for your questions.There’s currently no officially supported way to do this (there’s some work that needs to be done on it, for example it should convert JSON to YAML when it imports), but the Editor will pick up on a
url
configuration option. You can set it in the configuration object you pass to Swagger-Editor, or in the query string of the URL you’re using to access the Editor.Again, this is not officially supported, but you can pass a spec as a JavaScript object in through the configuration object only, as the
spec
option.If you want to add YAML… that’s trickier. You’ll need to reach into the Editor’s internals to do that, here’s an example:
This method is not part of our public API, and may change when the project’s minor version changes. That said, it hasn’t changed since 3.0.0.
You can write a plugin that achieves this:
See my answer above that uses
updateSpec
.Hopefully this helps. The use cases your questions allude to are valid, and I’d love to see first-class interfaces for them (I imagine a
onEditorValueChange
callback config option, and a betterspec
option, for starters), but our resources are limited - if you have the time to submit a PR for any of this, it’d be appreciated!