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,
),
),
tags: [id],
paths: paths,
).toMap(),
),

16
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<String, dynamic> toMap() => {
'openapi': version,
'info': info.toMap(),
'tags': tags.map((final tag) => <String, String>{'name': tag}).toList(),
'paths': paths.map((final key, final value) => MapEntry(key, value.toMap())),
if (tags != null) ...{
'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 Info info;
final List<String> tags;
final Map<String, Path> paths;
final List<String>? tags;
final Map<String, Path>? paths;
}
class Info {

2
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,
}

1
tool/generate-specs.sh

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

Loading…
Cancel
Save