oapi-profile-builder 3.7.4__tar.gz → 3.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. {oapi_profile_builder-3.7.4/src/oapi_profile_builder.egg-info → oapi_profile_builder-3.8.0}/PKG-INFO +1 -1
  2. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/pyproject.toml +1 -1
  3. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/src/oapi_profile_builder/generate.py +28 -9
  4. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0/src/oapi_profile_builder.egg-info}/PKG-INFO +1 -1
  5. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/LICENSE +0 -0
  6. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/README.md +0 -0
  7. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/setup.cfg +0 -0
  8. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/src/oapi_profile_builder/__init__.py +0 -0
  9. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/src/oapi_profile_builder/cite.py +0 -0
  10. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/src/oapi_profile_builder/cite_features.py +0 -0
  11. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/src/oapi_profile_builder/cli.py +0 -0
  12. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/src/oapi_profile_builder/compile.py +0 -0
  13. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/src/oapi_profile_builder/cover.py +0 -0
  14. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/src/oapi_profile_builder/models.py +0 -0
  15. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/src/oapi_profile_builder/server_validation.py +0 -0
  16. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/src/oapi_profile_builder.egg-info/SOURCES.txt +0 -0
  17. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/src/oapi_profile_builder.egg-info/dependency_links.txt +0 -0
  18. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/src/oapi_profile_builder.egg-info/entry_points.txt +0 -0
  19. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/src/oapi_profile_builder.egg-info/requires.txt +0 -0
  20. {oapi_profile_builder-3.7.4 → oapi_profile_builder-3.8.0}/src/oapi_profile_builder.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oapi-profile-builder
3
- Version: 3.7.4
3
+ Version: 3.8.0
4
4
  Summary: Authoritative tooling for creating OGC API Service Profiles (EDR, Features)
5
5
  Author-email: Shane Mill <shane.mill@noaa.gov>
6
6
  License: Apache License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "oapi-profile-builder"
7
- version = "3.7.4"
7
+ version = "3.8.0"
8
8
  description = "Authoritative tooling for creating OGC API Service Profiles (EDR, Features)"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -44,7 +44,7 @@ from oapi_profile_builder.models import ServiceProfile
44
44
  def _const(val, version: str) -> dict:
45
45
  if version == "3.1.0":
46
46
  return {"const": val}
47
- return {"enum": [val]}
47
+ return {"enum": [val], "default": val}
48
48
 
49
49
  def _contains(schema: dict, version: str) -> dict:
50
50
  if version == "3.1.0":
@@ -189,7 +189,7 @@ def _landing_page_schema(profile: "ServiceProfile") -> dict:
189
189
  schema_props["keywords"] = {
190
190
  "type": "array",
191
191
  "items": {"type": "string"},
192
- "enum": [profile.keywords]
192
+ **_const(profile.keywords, version)
193
193
  }
194
194
 
195
195
  if profile.provider:
@@ -685,10 +685,20 @@ def _collection_response_schema(coll: Collection,
685
685
 
686
686
  output_formats_schema: dict = {"type": "array", "items": {"type": "string"}}
687
687
  if coll.output_formats:
688
- output_formats_schema["items"] = {"type": "string", "enum": list(coll.output_formats)}
688
+ output_formats_schema = {
689
+ "type": "array",
690
+ "items": {"type": "string"},
691
+ **_const(list(coll.output_formats), version)
692
+ }
689
693
 
690
- if coll.crs: crs_array_schema: dict = {"type": "array", "items": {"type": "string", "enum": list(coll.crs)}}
691
- else: crs_array_schema = {"type": "array", "items": supported_crs_schema}
694
+ if coll.crs:
695
+ crs_array_schema: dict = {
696
+ "type": "array",
697
+ "items": {"type": "string"},
698
+ **_const(list(coll.crs), version)
699
+ }
700
+ else:
701
+ crs_array_schema = {"type": "array", "items": supported_crs_schema}
692
702
 
693
703
  extent_props: dict = {}
694
704
  if coll.extent and coll.extent.spatial:
@@ -783,8 +793,18 @@ def _collection_response_schema(coll: Collection,
783
793
  "id": {"type": "string", **_const(coll.id, version)},
784
794
  "title": {"type": "string", **_const(coll.title, version)} if coll.title else {"type": "string"},
785
795
  "description": {"type": "string", **_const(coll.description, version)} if coll.description else {"type": "string"},
786
- "keywords": {"type": "array", "items": {"type": "string"}, "enum": [coll.keywords] if coll.keywords else [[]]},
787
- "links": {"type": "array", "items": _LINK_SCHEMA, "enum": [links_to_show]}, "crs": crs_array_schema, "output_formats": output_formats_schema,
796
+ "keywords": {
797
+ "type": "array",
798
+ "items": {"type": "string"},
799
+ **(_const(coll.keywords, version) if coll.keywords else {})
800
+ },
801
+ "links": {
802
+ "type": "array",
803
+ "items": _LINK_SCHEMA,
804
+ **_const(links_to_show, version)
805
+ },
806
+ "crs": crs_array_schema,
807
+ "output_formats": output_formats_schema,
788
808
  "parameter_names": {**param_names_schema, "additionalProperties": False},
789
809
  "extent": {"type": "object", "required": ["spatial"], "properties": extent_props},
790
810
  "data_queries": {"type": "object", "properties": dq_props, "additionalProperties": False}
@@ -1123,11 +1143,10 @@ def _core_paths(profile: ServiceProfile) -> dict:
1123
1143
  if version == "3.1.0":
1124
1144
  schema["properties"]["conformsTo"]["contains"] = {"enum": profile.required_conformance_classes}
1125
1145
  else:
1126
- # Force listing all expected classes in Swagger UI by using enum at the array level
1127
1146
  schema["properties"]["conformsTo"] = {
1128
1147
  "type": "array",
1129
1148
  "items": {"type": "string"},
1130
- "enum": [profile.required_conformance_classes]
1149
+ **_const(profile.required_conformance_classes, version)
1131
1150
  }
1132
1151
 
1133
1152
  return {
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oapi-profile-builder
3
- Version: 3.7.4
3
+ Version: 3.8.0
4
4
  Summary: Authoritative tooling for creating OGC API Service Profiles (EDR, Features)
5
5
  Author-email: Shane Mill <shane.mill@noaa.gov>
6
6
  License: Apache License