mirror of
https://github.com/LukeHagar/OpenAPI.gg.git
synced 2025-12-06 04:20:29 +00:00
fix download system
This commit is contained in:
@@ -5,11 +5,9 @@
|
||||
|
||||
$: fileName = filenamify($openApiStore?.info?.title) || 'openapi';
|
||||
|
||||
// TODO: Refactor this to use the new storage instead of localstorage
|
||||
const saveYAML = () => {
|
||||
const openApiStorage = localStorage.getItem(`${localStoragePrefix}openApi`);
|
||||
if (!openApiStorage) return;
|
||||
const openApi = JSON.parse(openApiStorage);
|
||||
if (!$openApiStore) return;
|
||||
const openApi = $openApiStore;
|
||||
const blob = new Blob([stringify(openApi, null, { indent: 2, aliasDuplicateObjects: false })], {
|
||||
type: 'application/yaml'
|
||||
});
|
||||
@@ -21,12 +19,10 @@
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
};
|
||||
|
||||
// TODO: Refactor this to use the new storage instead of localstorage
|
||||
|
||||
const saveJSON = () => {
|
||||
const openApiStorage = localStorage.getItem(`${localStoragePrefix}openApi`);
|
||||
if (!openApiStorage) return;
|
||||
const openApi = JSON.parse(openApiStorage);
|
||||
if (!$openApiStore) return;
|
||||
const openApi = $openApiStore;
|
||||
const blob = new Blob([JSON.stringify(openApi, null, 2)], {
|
||||
type: 'application/json'
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@ export const localStoragePrefix = 'openapigen-';
|
||||
|
||||
export const blankSpec: OpenAPIV3_1.Document = {
|
||||
openapi: '3.1.0', // OpenAPI version
|
||||
jsonSchemaDialect: 'https://json-schema.org/draft/2020-12/schema', // JSON Schema version
|
||||
info: {
|
||||
/** Title of the API (required) */
|
||||
title: '',
|
||||
|
||||
Reference in New Issue
Block a user