Skip to content

Bug when updating main form data of app aarsregnskap-ideelle-202402 #1364

Description

@omtvad

Description of the bug

Hello,

When testing API of submitting form aarsregnskap-ideelle-202402 we received the 500 Internal Server Error.
tag is not included in the attached XML. We should receive some kind of error code/error message explaining that a required variable is missing.

Steps To Reproduce

  1. Make a schema that strictly follows the rules of the XSD file with variables that have the attribute use="required".
  2. Upload XML data that lacks a variable that has the attribute use="required" in the XSD definition.
  3. Error code 500 Internal Server Error will be received as the response.

Additional Information

<melding xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" dataFormatId="1266" dataFormatVersion="51820" tjenestehandling="aarsregnskap_vanlig" tjeneste="regnskap" xmlns="http://schema.brreg.no/regnsys/aarsregnskap_vanlig"><Innsender><enhet><organisasjonsnummer orid="18">312999358</organisasjonsnummer><organisasjonsform orid="756">AS</organisasjonsform><navn orid="1">DYPSINDIG SJELDEN TIGER AS</navn></enhet><kontaktperson altinnRowId="57f3e9ba-3bd5-44a9-a9ef-1e7ca0997ba9"><e-post orid="19022">test@test.no</e-post></kontaktperson><opplysningerInnsending><landTilLand orid="35172">true</landTilLand><noteMaskinellBehandling orid="37499">20</noteMaskinellBehandling></opplysningerInnsending></Innsender><Skjemainnhold><regnskapsperiode><regnskapsaar orid="17102">2018</regnskapsaar><regnskapsstart orid="17103">2018-01-01</regnskapsstart><regnskapsslutt orid="17104">2018-12-31</regnskapsslutt></regnskapsperiode><konsern><morselskap orid="4168">ja</morselskap><konsernregnskap orid="25943">ja</konsernregnskap></konsern><regnskapsprinsipper><smaaForetak orid="8079">nei</smaaForetak><regnskapsreglerSelskap orid="25021">nei</regnskapsreglerSelskap><forenkletIFRS orid="36639">nei</forenkletIFRS><regnskapsreglerKonsern orid="25944">nei</regnskapsreglerKonsern><forenkletIFRSKonsern orid="36641">nei</forenkletIFRSKonsern></regnskapsprinsipper><fastsettelse><fastsettelsedato orid="17105">2025-04-01</fastsettelsedato><bekreftendeSelskapsrepresentant orid="19023">RØD KLOVN</bekreftendeSelskapsrepresentant></fastsettelse><revisjonRegnskapsfoerer><aarsregnskapIkkeRevideres orid="34669">nei</aarsregnskapIkkeRevideres><aarsregnskapUtarbeidetAutorisertRegnskapsfoerer orid="34670">ja</aarsregnskapUtarbeidetAutorisertRegnskapsfoerer><tjenestebistandEksternAutorisertRegnskapsfoerer orid="34671">ja</tjenestebistandEksternAutorisertRegnskapsfoerer></revisjonRegnskapsfoerer><aarsberetning /></Skjemainnhold></melding>

compared to XSD:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://schema.brreg.no/regnsys/aarsregnskap_ideelle" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schema.brreg.no/regnsys/aarsregnskap_ideelle" elementFormDefault="qualified">
	<xs:annotation>
		<xs:documentation>
			<xs:attribute name="domenenavn" fixed="Regnskapsregisteret"/>
			<xs:attribute name="modellnavn" fixed="RR0010H_M"/>
		</xs:documentation>
	</xs:annotation>
	<xs:element name="melding" type="RR0010H_M"/>
	<xs:complexType name="RR0010H_M">
		<xs:sequence>
			<xs:element name="Innsender" type="Innsender"/>
			<xs:element name="Skjemainnhold" type="Skjemainnhold"/>
		</xs:sequence>
		<xs:attribute name="dataFormatId" type="xs:string" use="required" fixed="3430"/>
		<xs:attribute name="dataFormatVersion" type="xs:string" use="required" fixed="48617"/>
		<xs:attribute name="tjenestehandling" type="xs:string" use="required" fixed="aarsregnskap_ideelle"/>
		<xs:attribute name="tjeneste" type="xs:string" use="required" fixed="regnskap"/>
		<xs:anyAttribute/>
	</xs:complexType>
	<xs:complexType name="Innsender">
		<xs:sequence>
			<xs:element name="enhet" type="Enhet"/>
			<xs:element name="kontaktperson" type="Kontaktperson" minOccurs="0" maxOccurs="10"/>
			<xs:element name="opplysningerInnsending" type="OpplysningerInnsending"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="Enhet">
		<xs:sequence>
			<xs:element name="organisasjonsnummer" type="EnhetOrganisasjonsnummer"/>
			<xs:element name="organisasjonsform" type="EnhetOrganisasjonsform"/>
			<xs:element name="navn" type="EnhetNavn"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="EnhetOrganisasjonsnummer">
		<xs:simpleContent>
			<xs:extension base="HeltallNi">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="18"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="EnhetOrganisasjonsform">
		<xs:simpleContent>
			<xs:extension base="TekstTrettiFemTegn">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="756"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="EnhetNavn">
		<xs:simpleContent>
			<xs:extension base="TekstHundreOgSyttiFemTegn">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="1"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="Kontaktperson">
		<xs:sequence>
			<xs:element name="e-post" type="KontaktpersonEPost" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="KontaktpersonEPost">
		<xs:simpleContent>
			<xs:extension base="TekstSyttiTegn">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="19022"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="Taksonomi">
		<xs:sequence>
			<xs:element name="berekraftstaksonomi" type="Berekraftstaksonomi" minOccurs="0"/>
			<xs:element name="berekraftsversjon" type="Berekraftsversjon" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="OpplysningerInnsending">
		<xs:sequence>
			<xs:element name="landTilLand" type="ArsregnskapLandTilLand" minOccurs="0"/>
			<xs:element name="avviklingsregnskap" type="Avviklingsregnskap" minOccurs="0"/>
			<xs:element name="systemNavn" type="SystemNavn"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="ArsregnskapLandTilLand">
		<xs:simpleContent>
			<xs:extension base="Boolean">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="35172"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="Avviklingsregnskap">
		<xs:simpleContent>
			<xs:extension base="Boolean">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="40314"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="SystemNavn">
		<xs:simpleContent>
			<xs:extension base="TekstFemtiTegn">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="39007"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="Skjemainnhold">
		<xs:sequence>
			<xs:element name="regnskapsperiode" type="Regnskapsperiode"/>
			<xs:element name="konsern" type="Konsern"/>
			<xs:element name="regnskapsprinsipper" type="Regnskapsprinsipper"/>
			<xs:element name="fastsettelse" type="Fastsettelse"/>
			<xs:element name="revisjonRegnskapsfoerer" type="RevisjonRegnskapsfoerer" minOccurs="0"/>
			<xs:element name="aarsberetning" type="Aarsberetning" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="Regnskapsperiode">
		<xs:sequence>
			<xs:element name="regnskapsaar" type="RegnskapAr"/>
			<xs:element name="regnskapsstart" type="RegnskapStartdato"/>
			<xs:element name="regnskapsslutt" type="RegnskapAvslutningsdato"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="RegnskapAr">
		<xs:simpleContent>
			<xs:extension base="Tekst">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="17102"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="RegnskapStartdato">
		<xs:simpleContent>
			<xs:extension base="Dato">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="17103"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="RegnskapAvslutningsdato">
		<xs:simpleContent>
			<xs:extension base="Dato">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="17104"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="Konsern">
		<xs:sequence>
			<xs:element name="morselskap" type="Morselskap"/>
			<xs:element name="konsernregnskap" type="KonsernregnskapVedlegg" minOccurs="0"/>
			<xs:element name="utenlandskKonsern" type="UtenlandskKonsern" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="Morselskap">
		<xs:simpleContent>
			<xs:extension base="SvarJaNei">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="4168"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="KonsernregnskapVedlegg">
		<xs:simpleContent>
			<xs:extension base="SvarJaNei">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="25943"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="UtenlandskKonsern">
		<xs:simpleContent>
			<xs:extension base="SvarJaNei">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="36640"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="Regnskapsprinsipper">
		<xs:sequence>
			<xs:element name="smaaForetak" type="RegnskapsreglerSmaForetak"/>
			<xs:element name="regnskapsreglerSelskap" type="RegnskapsoppsettIFRS"/>
			<xs:element name="forenkletIFRS" type="ForenkletIFRS" minOccurs="0"/>
			<xs:element name="regnskapsreglerKonsern" type="RegnskapsoppsettKonsernIFRS" minOccurs="0"/>
			<xs:element name="forenkletIFRSKonsern" type="ForenkletIFRSKonsern" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="RegnskapsreglerSmaForetak">
		<xs:simpleContent>
			<xs:extension base="SvarJaNei">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="8079"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="RegnskapsoppsettIFRS">
		<xs:simpleContent>
			<xs:extension base="SvarNeiJa">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="25021"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="ForenkletIFRS">
		<xs:simpleContent>
			<xs:extension base="SvarJaNei">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="36639"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="RegnskapsoppsettKonsernIFRS">
		<xs:simpleContent>
			<xs:extension base="SvarNeiJa">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="25944"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="ForenkletIFRSKonsern">
		<xs:simpleContent>
			<xs:extension base="SvarJaNei">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="36641"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="RevisjonRegnskapsfoerer">
		<xs:sequence>
			<xs:element name="aarsregnskapIkkeRevideres" type="ArsregnskapIkkeRevisjonBesluttet" minOccurs="0"/>
			<xs:element name="aarsregnskapUtarbeidetAutorisertRegnskapsfoerer" type="ArsregnskapUtarbeidelseAvAutorisertRegnskapsforer" minOccurs="0"/>
			<xs:element name="tjenestebistandEksternAutorisertRegnskapsfoerer" type="TjenestebistandEksternAutorisertRegnskapsforer" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="Aarsberetning">
		<xs:sequence>
			<xs:element name="inkludererBerekraftrapportering" type="InkludererBerekraftrapportering" minOccurs="0"/>
			<xs:element name="berekraftsrapporteringsstandard" type="Berekraftsrapporteringsstandard" minOccurs="0" maxOccurs="2"/>
			<xs:element name="taksonomi" type="Taksonomi" minOccurs="0" maxOccurs="2"/>
			<xs:element name="leiNummer" type="LeiNummer" minOccurs="0"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="ArsregnskapIkkeRevisjonBesluttet">
		<xs:simpleContent>
			<xs:extension base="SvarJaNei">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="34669"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="ArsregnskapUtarbeidelseAvAutorisertRegnskapsforer">
		<xs:simpleContent>
			<xs:extension base="SvarJaNei">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="34670"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="TjenestebistandEksternAutorisertRegnskapsforer">
		<xs:simpleContent>
			<xs:extension base="SvarJaNei">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="34671"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="Berekraftsversjon">
		<xs:simpleContent>
			<xs:extension base="TekstTjueTegn">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="40312"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="LeiNummer">
		<xs:simpleContent>
			<xs:extension base="TekstTjueTegn">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="40313"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="InkludererBerekraftrapportering">
		<xs:simpleContent>
			<xs:extension base="SvarJaNei">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="40309"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="Berekraftsrapporteringsstandard">
		<xs:simpleContent>
			<xs:extension base="TekstTjueTegn">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="40310"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="Berekraftstaksonomi">
		<xs:simpleContent>
			<xs:extension base="TekstTjueTegn">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="40311"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="Fastsettelse">
		<xs:sequence>
			<xs:element name="fastsettelsesdato" type="RegnskapFastsettelseDato"/>
			<xs:element name="bekreftendeSelskapsrepresentant" type="StyremedlemNavnSpesifisertStyremedlem"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="RegnskapFastsettelseDato">
		<xs:simpleContent>
			<xs:extension base="Dato">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="17105"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="StyremedlemNavnSpesifisertStyremedlem">
		<xs:simpleContent>
			<xs:extension base="TekstSyttiTegn">
				<xs:attribute name="orid" type="xs:string" use="required" fixed="19023"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:simpleType name="HeltallNi">
		<xs:restriction base="xs:string">
			<xs:length value="9"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="TekstTrettiFemTegn">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="35"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="TekstHundreOgSyttiFemTegn">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="175"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="Boolean">
		<xs:restriction base="xs:string">
			<xs:enumeration value="true"/>
			<xs:enumeration value="false"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="TekstFemtiTegn">
		<xs:restriction base="xs:string">
			<xs:maxLength value="50"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="Tekst">
		<xs:restriction base="xs:string"/>
	</xs:simpleType>
	<xs:simpleType name="SvarNeiJa">
		<xs:restriction base="xs:string">
			<xs:enumeration value="nei"/>
			<xs:enumeration value="ja"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="SvarJaNei">
		<xs:restriction base="xs:string">
			<xs:enumeration value="ja"/>
			<xs:enumeration value="nei"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="Dato">
		<xs:restriction base="xs:date"/>
	</xs:simpleType>
	<xs:simpleType name="TekstSyttiTegn">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="70"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="TekstTjueTegn">
		<xs:restriction base="xs:string">
			<xs:minLength value="1"/>
			<xs:maxLength value="20"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't workingorg/brgIssues relevant for Brønnøysundregistrene.squad/dataIssues that belongs to the named squad.status/triage

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions