Commit 04bcdcde authored by Pierre Dittgen's avatar Pierre Dittgen
Browse files

formatting

parent 484295a3
......@@ -13,12 +13,15 @@ import jsonschema
import requests
import validata_core
from commonmark import commonmark
from flask import (abort, make_response, redirect, render_template, request,
url_for)
from flask import abort, make_response, redirect, render_template, request, url_for
from opendataschema import GitSchemaReference, by_commit_date
from validata_core.helpers import (FileContentValidataResource,
URLValidataResource, ValidataResource,
is_body_error, is_structure_error)
from validata_core.helpers import (
FileContentValidataResource,
URLValidataResource,
ValidataResource,
is_body_error,
is_structure_error,
)
from . import app, config, fetch_schema, pdf_service, schema_catalog_registry
from .model import Section
......@@ -134,10 +137,14 @@ class SchemaInstance:
def request_parameters(self):
"""Build request parameter dict to identify schema."""
return {
"schema_name": self.schema_and_section_name,
"schema_ref": "" if self.ref is None else self.ref,
} if self.name else {"schema_url": self.url}
return (
{
"schema_name": self.schema_and_section_name,
"schema_ref": "" if self.ref is None else self.ref,
}
if self.name
else {"schema_url": self.url}
)
def find_section_title(self, section_name):
"""Return section title or None if not found."""
......@@ -344,6 +351,7 @@ def get_badge_url_and_message(badge):
def validate(schema_instance: SchemaInstance, validata_resource: ValidataResource):
"""Validate source and display report."""
def compute_resource_info(resource: ValidataResource):
source = resource.get_source()
return {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment