{"openapi":"3.1.0","info":{"title":"Lex API","description":"UK Legal API for AI agents with MCP support","version":"0.0.0"},"paths":{"/legislation/section/search":{"post":{"tags":["legislation"],"summary":"Search within specific sections of legislation","description":"Find text within sections of Acts, SIs, or other legislation types. Use for detailed content searches.","operationId":"search_for_legislation_sections","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegislationSectionSearch"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/LegislationSection"},"type":"array","title":"Response Search For Legislation Sections"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/legislation/search":{"post":{"tags":["legislation"],"summary":"Search for Acts and Statutory Instruments","description":"Find legislation by title, content, or metadata. Returns full Acts and SIs with match scores.","operationId":"search_for_legislation_acts","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegislationActSearch"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegislationSearchResponse"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/legislation/lookup":{"post":{"tags":["legislation"],"summary":"Get specific legislation by type, year, and number","description":"Retrieve a single Act or SI using its official citation (e.g. ukpga/2018/12).","operationId":"lookup_legislation","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegislationLookup"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Legislation"}}}},"404":{"description":"Legislation not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/legislation/section/lookup":{"post":{"tags":["legislation"],"summary":"Get all sections for specific legislation","description":"Retrieve the complete structure and content of all sections within a piece of legislation.","operationId":"get_legislation_sections","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegislationSectionLookup"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/LegislationSection"},"type":"array","title":"Response Get Legislation Sections"}}}},"404":{"description":"No sections found for the specified legislation title"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/legislation/text":{"post":{"tags":["legislation"],"summary":"Get complete text content of legislation","description":"Retrieve the full text content of an Act or SI as a single document.","operationId":"get_legislation_full_text","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegislationFullTextLookup"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegislationFullText"}}}},"404":{"description":"Legislation not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/legislation/proxy/{legislation_id}":{"get":{"tags":["legislation"],"summary":"Proxy Legislation Data","description":"Proxy endpoint to fetch enriched metadata from legislation.gov.uk.\n\nArgs:\n    legislation_id: The legislation ID (e.g., \"ukpga/2018/12\")\n\nReturns:\n    HTML content from legislation.gov.uk with CORS headers","operationId":"proxy_legislation_data","parameters":[{"name":"legislation_id","in":"path","required":true,"schema":{"type":"string","title":"Legislation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"404":{"description":"Legislation not found"},"502":{"description":"External API error"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/explanatory_note/section/search":{"post":{"tags":["explanatory_note"],"summary":"Search explanatory notes by content","description":"Find explanatory notes by text content across all legislation types.","operationId":"search_explanatory_note","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplanatoryNoteSearch"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ExplanatoryNote"},"type":"array","title":"Response Search Explanatory Note"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/explanatory_note/legislation/lookup":{"post":{"tags":["explanatory_note"],"summary":"Get explanatory notes for specific legislation","description":"Retrieve all explanatory notes associated with a particular Act or SI.","operationId":"get_explanatory_note_by_legislation","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplanatoryNoteLookup"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ExplanatoryNote"},"type":"array","title":"Response Get Explanatory Note By Legislation"}}}},"404":{"description":"Explanatory notes not found for the specified legislation"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/explanatory_note/section/lookup":{"post":{"tags":["explanatory_note"],"summary":"Get explanatory note for specific section","description":"Retrieve the explanatory note that explains a particular section of legislation.","operationId":"get_explanatory_note_by_section","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplanatoryNoteSectionLookup"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExplanatoryNote"}}}},"404":{"description":"Explanatory note section not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/amendment/search":{"post":{"tags":["amendment"],"summary":"Search legislative amendments","description":"Find amendments to Acts and SIs by content, title, or affected legislation.","operationId":"search_amendments","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmendmentSearch"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Amendment"},"type":"array","title":"Response Search Amendments"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/amendment/section/search":{"post":{"tags":["amendment"],"summary":"Search within amendment sections","description":"Find text within specific sections of legislative amendments.","operationId":"search_amendment_sections","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AmendmentSectionSearch"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Amendment"},"type":"array","title":"Response Search Amendment Sections"}}}},"404":{"description":"Not found"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/stats":{"get":{"tags":["stats"],"summary":"Get Live Stats","description":"Get live dataset statistics with 5-minute caching.","operationId":"get_live_stats_api_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Live Stats Api Stats Get"}}}}}}},"/healthcheck":{"get":{"summary":"Health Check","description":"Health check with Qdrant connection verification.","operationId":"health_check_healthcheck_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"Amendment":{"properties":{"changed_legislation":{"type":"string","title":"Changed Legislation"},"changed_year":{"type":"integer","title":"Changed Year"},"changed_number":{"type":"string","title":"Changed Number"},"changed_url":{"type":"string","title":"Changed Url"},"changed_provision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Changed Provision"},"changed_provision_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Changed Provision Url"},"affecting_legislation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Affecting Legislation"},"affecting_year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Affecting Year"},"affecting_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Affecting Number"},"affecting_url":{"type":"string","title":"Affecting Url"},"affecting_provision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Affecting Provision"},"affecting_provision_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Affecting Provision Url"},"type_of_effect":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type Of Effect"},"id":{"type":"string","title":"Id"},"ai_explanation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Explanation","description":"AI-generated plain English explanation of what this amendment does"},"ai_explanation_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Explanation Model","description":"Model used to generate explanation (e.g., 'gpt-5-mini')"},"ai_explanation_timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ai Explanation Timestamp","description":"When the explanation was generated"}},"type":"object","required":["changed_legislation","changed_year","changed_number","changed_url","affecting_url","id"],"title":"Amendment","description":"A model for an amendment to a piece of legislation, taken from the legislation.gov.uk page."},"AmendmentSearch":{"properties":{"legislation_id":{"type":"string","title":"Legislation Id","description":"ID of the legislation to search amendments for. Accepts short form (e.g., 'ukpga/1998/42') or full URL.","examples":["ukpga/1998/42","uksi/2018/12"]},"search_amended":{"type":"boolean","title":"Search Amended","description":"If True, search for amendments made to the legislation. If False, search for amendments made by the legislation.","default":true},"size":{"type":"integer","title":"Size","description":"Maximum number of results to return.","default":100}},"type":"object","required":["legislation_id"],"title":"AmendmentSearch","description":"Search for amendments at the legislation level."},"AmendmentSectionSearch":{"properties":{"provision_id":{"type":"string","title":"Provision Id","description":"ID of the provision/section to search amendments for. Accepts short form (e.g., 'ukpga/1998/42/section/3') or full URL.","examples":["ukpga/1998/42/section/3","uksi/2018/12/regulation/5"]},"search_amended":{"type":"boolean","title":"Search Amended","description":"If True, search for amendments made to the provision. If False, search for amendments made by the provision.","default":true},"size":{"type":"integer","title":"Size","description":"Maximum number of results to return.","default":100}},"type":"object","required":["provision_id"],"title":"AmendmentSectionSearch","description":"Search for amendments at the provision/section level."},"ExplanatoryNote":{"properties":{"created_at":{"type":"string","format":"date-time","title":"Created At"},"text":{"type":"string","title":"Text"},"id":{"type":"string","title":"Id"},"legislation_id":{"type":"string","title":"Legislation Id"},"note_type":{"anyOf":[{"$ref":"#/components/schemas/ExplanatoryNoteType"},{"type":"null"}],"description":"The type of explanatory note"},"route":{"items":{"type":"string"},"type":"array","title":"Route"},"section_type":{"anyOf":[{"$ref":"#/components/schemas/ExplanatoryNoteSectionType"},{"type":"null"}]},"section_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Section Number"},"order":{"type":"integer","title":"Order"}},"type":"object","required":["text","id","legislation_id","route","order"],"title":"ExplanatoryNote"},"ExplanatoryNoteLookup":{"properties":{"legislation_id":{"type":"string","title":"Legislation Id","description":"The ID of the legislation to look up explanatory notes for. Accepts short form (e.g., 'ukpga/1998/42') or full URL.","examples":["ukpga/1998/42","uksi/2018/12"]},"limit":{"type":"integer","title":"Limit","description":"Maximum number of results to return.","default":1000}},"type":"object","required":["legislation_id"],"title":"ExplanatoryNoteLookup","description":"Lookup explanatory notes for a specific legislation by ID."},"ExplanatoryNoteSearch":{"properties":{"query":{"type":"string","title":"Query","description":"The natural language query to search for explanatory notes. If empty, will return all notes matching the filters.","default":""},"legislation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legislation Id","description":"Filter by legislation ID to search within a specific piece of legislation. Accepts short form (e.g., 'ukpga/1998/42') or full URL. If not provided, all legislation will be included.","examples":["ukpga/1998/42","uksi/2018/12"]},"note_type":{"anyOf":[{"items":{"$ref":"#/components/schemas/ExplanatoryNoteType"},"type":"array"},{"type":"null"}],"title":"Note Type","description":"Filter by note type (overview, policy_background, legal_background, extent, provisions, commencement, related_documents)."},"section_type":{"anyOf":[{"items":{"$ref":"#/components/schemas/ExplanatoryNoteSectionType"},"type":"array"},{"type":"null"}],"title":"Section Type","description":"Filter by section type (section, schedule, part)."},"size":{"type":"integer","title":"Size","description":"Maximum number of results to return.","default":20}},"type":"object","title":"ExplanatoryNoteSearch","description":"Search for explanatory notes that match the given query."},"ExplanatoryNoteSectionLookup":{"properties":{"legislation_id":{"type":"string","title":"Legislation Id","description":"The ID of the legislation to look up an explanatory note for. Accepts short form (e.g., 'ukpga/1998/42') or full URL.","examples":["ukpga/1998/42","uksi/2018/12"]},"section_number":{"type":"integer","title":"Section Number","description":"The section number to look up an explanatory note for."}},"type":"object","required":["legislation_id","section_number"],"title":"ExplanatoryNoteSectionLookup","description":"Lookup a specific explanatory note section by legislation ID and section number."},"ExplanatoryNoteSectionType":{"type":"string","enum":["section","schedule","part"],"title":"ExplanatoryNoteSectionType"},"ExplanatoryNoteType":{"type":"string","enum":["overview","policy_background","legal_background","extent","provisions","commencement"],"title":"ExplanatoryNoteType"},"GeographicalExtent":{"type":"string","enum":["England","Wales","Scotland","Northern Ireland","United Kingdom",""],"title":"GeographicalExtent","description":"Represents the valid geographical extent of legislation."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Legislation":{"properties":{"created_at":{"type":"string","format":"date-time","title":"Created At"},"text":{"type":"string","title":"Text","description":"Combined text content of the legislation.","default":""},"id":{"type":"string","title":"Id"},"uri":{"type":"string","title":"Uri"},"title":{"type":"string","title":"Title"},"description":{"type":"string","title":"Description"},"enactment_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Enactment Date"},"valid_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Valid Date"},"modified_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Modified Date"},"publisher":{"type":"string","title":"Publisher"},"category":{"$ref":"#/components/schemas/LegislationCategory"},"type":{"$ref":"#/components/schemas/LegislationType"},"year":{"type":"integer","title":"Year"},"number":{"type":"integer","title":"Number"},"status":{"type":"string","title":"Status"},"extent":{"items":{"$ref":"#/components/schemas/GeographicalExtent"},"type":"array","title":"Extent"},"number_of_provisions":{"type":"integer","title":"Number Of Provisions"},"provenance_source":{"anyOf":[{"type":"string","enum":["xml","llm_ocr"]},{"type":"null"}],"title":"Provenance Source"},"provenance_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provenance Model"},"provenance_prompt_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provenance Prompt Version"},"provenance_timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Provenance Timestamp"},"provenance_response_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provenance Response Id"}},"type":"object","required":["id","uri","title","description","publisher","category","type","year","number","status","number_of_provisions"],"title":"Legislation","description":"Represents a piece of legislation."},"LegislationActSearch":{"properties":{"query":{"type":"string","title":"Query","description":"The search query - can be a concept, question, or keywords.","examples":["human rights protections","What are the penalties for tax evasion?","data protection compliance"]},"year_from":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year From","description":"Starting year filter (optional)."},"year_to":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year To","description":"Ending year filter (optional)."},"legislation_type":{"anyOf":[{"items":{"$ref":"#/components/schemas/LegislationType"},"type":"array"},{"type":"null"}],"title":"Legislation Type","description":"List of legislation types to filter by (optional)."},"offset":{"type":"integer","minimum":0.0,"title":"Offset","description":"Number of results to skip (pagination).","default":0},"limit":{"type":"integer","title":"Limit","description":"Number of results to return.","default":10},"include_text":{"type":"boolean","title":"Include Text","description":"Whether to include full section text in results. Set to False for faster performance when only metadata is needed.","default":true}},"type":"object","required":["query"],"title":"LegislationActSearch","description":"Search for legislation using semantic hybrid search.\n\nSearches section content using dense (semantic) + sparse (BM25) embeddings,\nthen returns parent legislation ranked by best matching sections."},"LegislationCategory":{"type":"string","enum":["primary","secondary","european","euretained"],"title":"LegislationCategory","description":"High-level categorisation of legislation types.\n\nThis enum represents the three main categories of legislation:\n- PRIMARY: Main acts of parliament and assemblies\n- SECONDARY: Statutory instruments and rules\n- EUROPEAN: EU-derived legislation (Decisions, Directives, Regulations)\n- EUROPEAN_RETAINED: EU-derived legislation retained in UK law"},"LegislationFullText":{"properties":{"legislation":{"$ref":"#/components/schemas/Legislation","description":"The metadata of the legislation document."},"full_text":{"type":"string","title":"Full Text","description":"The full text of the legislation, concatenated from all sections."}},"type":"object","required":["legislation","full_text"],"title":"LegislationFullText","description":"Full text of legislation with metadata.\n\nThis model combines the metadata of a legislation document with its\nfull text (concatenated from all sections)."},"LegislationFullTextLookup":{"properties":{"legislation_id":{"type":"string","title":"Legislation Id","description":"The ID of the legislation document. Accepts short form (e.g., 'ukpga/1998/42') or full URL.","examples":["ukpga/1998/42","uksi/2018/12"]},"include_schedules":{"type":"boolean","title":"Include Schedules","description":"Whether to include schedules in the response. If False, only sections are returned. If True, sections are returned first, then schedules. Only request schedules if you are sure you need them.","default":false}},"type":"object","required":["legislation_id"],"title":"LegislationFullTextLookup","description":"Lookup the full text of a legislation document by its ID.\n\nThis model allows retrieval of legislation full text with optional inclusion of schedules."},"LegislationLookup":{"properties":{"legislation_type":{"$ref":"#/components/schemas/LegislationType","description":"The specific type of legislation","examples":["ukpga","uksi"]},"year":{"type":"integer","title":"Year","description":"The year the legislation was enacted.","examples":[1998,2018]},"number":{"type":"integer","title":"Number","description":"The number of the legislation.","examples":[42,12]}},"type":"object","required":["legislation_type","year","number"],"title":"LegislationLookup","description":"Lookup legislation by exact type, year, and number.\n\nThis model allows precise retrieval of legislation based on its unique identifiers."},"LegislationSearchResponse":{"properties":{"results":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Results","description":"List of legislation results (may include sections array)"},"total":{"type":"integer","title":"Total","description":"Total number of results available"},"offset":{"type":"integer","title":"Offset","description":"Current offset"},"limit":{"type":"integer","title":"Limit","description":"Number of results per page"}},"type":"object","required":["results","total","offset","limit"],"title":"LegislationSearchResponse","description":"Response model for legislation search with pagination metadata."},"LegislationSection":{"properties":{"created_at":{"type":"string","format":"date-time","title":"Created At"},"text":{"type":"string","title":"Text","description":"The text of the section.","default":""},"id":{"type":"string","title":"Id","description":"The ID of the section."},"uri":{"type":"string","title":"Uri"},"legislation_id":{"type":"string","title":"Legislation Id","description":"The ID of the legislation."},"title":{"type":"string","title":"Title","description":"The title of the section."},"extent":{"items":{"$ref":"#/components/schemas/GeographicalExtent"},"type":"array","title":"Extent"},"provision_type":{"$ref":"#/components/schemas/ProvisionType","default":"section"},"provenance_source":{"anyOf":[{"type":"string","enum":["xml","llm_ocr"]},{"type":"null"}],"title":"Provenance Source"},"provenance_model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provenance Model"},"provenance_prompt_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provenance Prompt Version"},"provenance_timestamp":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Provenance Timestamp"},"provenance_response_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provenance Response Id"},"number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Number","readOnly":true},"legislation_type":{"anyOf":[{"$ref":"#/components/schemas/LegislationType"},{"type":"null"}],"description":"Return the type of the legislation.","readOnly":true},"legislation_year":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Legislation Year","description":"Return the year of the legislation, handling regnal year URIs.","readOnly":true},"legislation_number":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Legislation Number","description":"Return the number of the legislation.","readOnly":true}},"type":"object","required":["id","uri","legislation_id","number","legislation_type","legislation_year","legislation_number"],"title":"LegislationSection"},"LegislationSectionLookup":{"properties":{"legislation_id":{"type":"string","title":"Legislation Id","description":"The ID of the legislation to retrieve sections for. Accepts short form (e.g., 'ukpga/1998/42') or full URL.","examples":["ukpga/1998/42","uksi/2018/12"]},"limit":{"type":"integer","title":"Limit","description":"The number of results to return.","default":10}},"type":"object","required":["legislation_id"],"title":"LegislationSectionLookup","description":"Lookup all the sections of a piece of legislation by legislation title."},"LegislationSectionSearch":{"properties":{"query":{"type":"string","title":"Query","description":"The natural language query to search for sections of legislation. If empty will return all sections matching filters.","examples":["employment termination procedures","data protection rights",""]},"legislation_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legislation Id","description":"The legislation_id to search within. Use this if you only want to search within a specific piece of legislation. Accepts both short format (e.g., 'ukpga/1994/13') and full URL format (e.g., 'http://www.legislation.gov.uk/id/ukpga/1994/13'). If not provided, all legislation will be included based on the other filters.","examples":["ukpga/1998/42","ukpga/2018/12"]},"legislation_category":{"anyOf":[{"items":{"$ref":"#/components/schemas/LegislationCategory"},"type":"array"},{"type":"null"}],"title":"Legislation Category","description":"The legislation category to filter by. If not provided, all categories will be included."},"legislation_type":{"anyOf":[{"items":{"$ref":"#/components/schemas/LegislationType"},"type":"array"},{"type":"null"}],"title":"Legislation Type","description":"The legislation type to filter by. If not provided, all types will be included."},"year_from":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year From","description":"The starting year for the legislation to filter by. If not provided, no filtering will be applied."},"year_to":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Year To","description":"The ending year for the legislation to filter by. If not provided, no filtering will be applied."},"offset":{"type":"integer","minimum":0.0,"title":"Offset","description":"The number of results to skip (for pagination).","default":0},"size":{"type":"integer","title":"Size","description":"The number of results to return.","default":10},"include_text":{"type":"boolean","title":"Include Text","description":"Whether to include full text in results. Set to False for faster performance when only metadata is needed.","default":true}},"type":"object","required":["query"],"title":"LegislationSectionSearch","description":"Search for legislation that is relevant to a specific query. Useful for finding sections of legislation that are relevant to a specific topic."},"LegislationType":{"type":"string","enum":["ukpga","asp","asc","anaw","wsi","uksi","ssi","ukcm","nisr","nia","eudn","eudr","eur","ukla","ukppa","apni","gbla","aosp","aep","apgb","mwa","aip","mnia","nisro","nisi","uksro","ukmo","ukci"],"title":"LegislationType","description":"Specific types of legislation.\n\nThis enum represents all possible legislation subtypes, mapped to their full names:\n- UKPGA: UK Public General Acts\n- ASP: Acts of the Scottish Parliament\n- ASC: Acts of Senedd Cymru\n- ANAW: Acts of the National Assembly for Wales\n- WSI: Wales Statutory Instruments\n- UKSI: UK Statutory Instruments\n- SSI: Scottish Statutory Instruments\n- UKCM: Church Measures\n- NISR: Northern Ireland Statutory Rules\n- NIA: Acts of the Northern Ireland Assembly\n- EUDN: Decisions originating from the EU\n- EUDR: Directives originating from the EU\n- EUR: Regulations originating from the EU\n- UKLA: UK Local Acts\n- UKPPA: UK Private and Personal Acts\n- APNI: Acts of the Northern Ireland Parliament\n- GBLA: Local Acts of the Parliament of Great Britain\n- AOSP: Acts of the Old Scottish Parliament\n- AEP: Acts of the English Parliament\n- APGB: Acts of the Parliament of Great Britain\n- MWA: Measures of the Welsh Assembly\n- AIP: Acts of the Old Irish Parliament\n- MNIA: Measures of the Northern Ireland Assembly\n- NISRO: Northern Ireland Statutory Rules and Orders\n- NISI: Northern Ireland Orders in Council\n- UKSRO: UK Statutory Rules and Orders\n- UKMO: UK Ministerial Orders\n- UKCI: Church Instruments"},"ProvisionType":{"type":"string","enum":["section","schedule"],"title":"ProvisionType","description":"Represents the type of provision."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}