Browse Source

spec_templates,tool: Do not output global tags

pull/202/head
jld3103 2 years ago
parent
commit
ff288066ff
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 1
      packages/spec_templates/bin/generate.dart
  2. 16
      packages/spec_templates/lib/openapi_spec.dart
  3. 2
      tool/generate-nextcloud.sh
  4. 1
      tool/generate-specs.sh

1
packages/spec_templates/bin/generate.dart

@ -314,7 +314,6 @@ Future main(final List<String> args) async {
identifier: spdxIdentifier, identifier: spdxIdentifier,
), ),
), ),
tags: [id],
paths: paths, paths: paths,
).toMap(), ).toMap(),
), ),

16
packages/spec_templates/lib/openapi_spec.dart

@ -4,21 +4,25 @@ class Spec {
Spec({ Spec({
required this.version, required this.version,
required this.info, required this.info,
required this.tags, this.tags,
required this.paths, this.paths,
}); });
Map<String, dynamic> toMap() => { Map<String, dynamic> toMap() => {
'openapi': version, 'openapi': version,
'info': info.toMap(), 'info': info.toMap(),
'tags': tags.map((final tag) => <String, String>{'name': tag}).toList(), if (tags != null) ...{
'paths': paths.map((final key, final value) => MapEntry(key, value.toMap())), 'tags': tags!.map((final tag) => <String, String>{'name': tag}).toList(),
},
if (paths != null) ...{
'paths': paths!.map((final key, final value) => MapEntry(key, value.toMap())),
},
}; };
final String version; final String version;
final Info info; final Info info;
final List<String> tags; final List<String>? tags;
final Map<String, Path> paths; final Map<String, Path>? paths;
} }
class Info { class Info {

2
tool/generate-nextcloud.sh

@ -33,7 +33,6 @@ for i in $(seq 0 $((${#codenames[@]} - 1))); do
info: .[0].info, info: .[0].info,
servers: .[0].servers, servers: .[0].servers,
security: .[0].security, security: .[0].security,
tags: (.[0].tags + .[1].tags),
components: (.[0].components * .[1].components), components: (.[0].components * .[1].components),
paths: (.[0].paths * .[1].paths), paths: (.[0].paths * .[1].paths),
}' \ }' \
@ -51,7 +50,6 @@ jq \
info: .info, info: .info,
servers: .servers, servers: .servers,
security: .security, security: .security,
tags: .tags,
components: .components, components: .components,
paths: .paths, paths: .paths,
} }

1
tool/generate-specs.sh

@ -56,7 +56,6 @@ for codename in ${codenames[*]}; do
basic_auth: [] basic_auth: []
} }
], ],
tags: .[1].tags,
components: { components: {
schemas: .[1].components.schemas schemas: .[1].components.schemas
}, },

Loading…
Cancel
Save