diff --git a/packages/spec_templates/bin/generate.dart b/packages/spec_templates/bin/generate.dart index 505469b8..dee3482c 100644 --- a/packages/spec_templates/bin/generate.dart +++ b/packages/spec_templates/bin/generate.dart @@ -314,7 +314,6 @@ Future main(final List args) async { identifier: spdxIdentifier, ), ), - tags: [id], paths: paths, ).toMap(), ), diff --git a/packages/spec_templates/lib/openapi_spec.dart b/packages/spec_templates/lib/openapi_spec.dart index 5b6f07ff..e7b811f9 100644 --- a/packages/spec_templates/lib/openapi_spec.dart +++ b/packages/spec_templates/lib/openapi_spec.dart @@ -4,21 +4,25 @@ class Spec { Spec({ required this.version, required this.info, - required this.tags, - required this.paths, + this.tags, + this.paths, }); Map toMap() => { 'openapi': version, 'info': info.toMap(), - 'tags': tags.map((final tag) => {'name': tag}).toList(), - 'paths': paths.map((final key, final value) => MapEntry(key, value.toMap())), + if (tags != null) ...{ + 'tags': tags!.map((final tag) => {'name': tag}).toList(), + }, + if (paths != null) ...{ + 'paths': paths!.map((final key, final value) => MapEntry(key, value.toMap())), + }, }; final String version; final Info info; - final List tags; - final Map paths; + final List? tags; + final Map? paths; } class Info { diff --git a/tool/generate-nextcloud.sh b/tool/generate-nextcloud.sh index 71bec3f6..6a3a664b 100755 --- a/tool/generate-nextcloud.sh +++ b/tool/generate-nextcloud.sh @@ -33,7 +33,6 @@ for i in $(seq 0 $((${#codenames[@]} - 1))); do info: .[0].info, servers: .[0].servers, security: .[0].security, - tags: (.[0].tags + .[1].tags), components: (.[0].components * .[1].components), paths: (.[0].paths * .[1].paths), }' \ @@ -51,7 +50,6 @@ jq \ info: .info, servers: .servers, security: .security, - tags: .tags, components: .components, paths: .paths, } diff --git a/tool/generate-specs.sh b/tool/generate-specs.sh index 8bb634eb..f5255189 100755 --- a/tool/generate-specs.sh +++ b/tool/generate-specs.sh @@ -56,7 +56,6 @@ for codename in ${codenames[*]}; do basic_auth: [] } ], - tags: .[1].tags, components: { schemas: .[1].components.schemas },