diff --git a/schemas/material_brdf_schema.json b/schemas/material_brdf_schema.json index 5380d75..aafdb16 100644 --- a/schemas/material_brdf_schema.json +++ b/schemas/material_brdf_schema.json @@ -74,17 +74,10 @@ }, "wavelengthRange": { "type": "array", - "description": "Wavelength range covered by the lookup table.", - "items": [ - { - "type": "number", - "description": "Min wavelength in meters." + "description": "Wavelength range covered by the lookup table. The first item is the minimum wavelength in meters and the second item is the maximum wavelength in meters.", + "items": { + "type": "number" }, - { - "type": "number", - "description": "Max wavelength in meters." - } - ], "minItems": 2, "maxItems": 2 }, @@ -95,9 +88,9 @@ }, "lookupTable": { "type": "array", + "description": "Array of bidirectional reflectance distribution function (BRDF) values, with each item representing a different property. The array SHALL be sorted based on the columns starting with the first.", "items": { "type": "array", - "description": "Array of bidirectional reflectance distribution function (BRDF) values, with each item representing a different property. The array SHALL be sorted based on the columns starting with the first.", "items": [ { "type": ["number", "null"], diff --git a/schemas/material_emp_schema.json b/schemas/material_emp_schema.json index 9c8c18d..dffe133 100644 --- a/schemas/material_emp_schema.json +++ b/schemas/material_emp_schema.json @@ -66,9 +66,9 @@ }, "electromagneticProperties": { "type": "array", + "description": "Array of electromagnetic property values, with each item representing a different property. The array SHALL be sorted based on the columns starting with the first.", "items": { "type": "array", - "description": "Array of electromagnetic property values, with each item representing a different property. The array SHALL be sorted based on the columns starting with the first.", "items": [ { "type": ["number", "null"], diff --git a/scripts/json2asciidoc.py b/scripts/json2asciidoc.py index eefaf47..d0c7c38 100644 --- a/scripts/json2asciidoc.py +++ b/scripts/json2asciidoc.py @@ -75,19 +75,22 @@ def generate_asciidoc_properties(properties, required_fields, level=2): for prop_name, prop_data in properties.items(): heading_prefix = "=" * level # Create heading based on level asciidoc_content += f"{heading_prefix} {prop_name}\n" - asciidoc_content += f"{prop_data.get('description', 'No description')}\n" + asciidoc_content += f"{prop_data.get('description', '')}\n" # Handle array types and generate description for array of arrays if prop_data.get('type') == "array": if isinstance(prop_data['items'], dict) and 'items' in prop_data['items']: # Generate list for array of arrays + asciidoc_content += "Instance\n" asciidoc_content += generate_asciidoc_array_of_arrays(prop_data['items']['items'], prop_data['items'].get('description', '')) + "\n" elif isinstance(prop_data['items'], list): # If it's a list of items, generate columns description directly + asciidoc_content += "list\n" asciidoc_content += generate_asciidoc_array_of_arrays(prop_data['items'], prop_data.get('description', '')) + "\n" else: # Simple array, include the description of the array - asciidoc_content += f"\n{prop_data['items'].get('description', 'No description')}\n" + asciidoc_content += "simple\n" + asciidoc_content += f"\n{prop_data['items'].get('description', '')}\n" # Add pattern inline and handle escaping of backslashes and curly braces if "pattern" in prop_data: