Comments (9)
I will look into that and create a seperate issue / PR for it.
I still feel like this option has it's use cases so I'll leave the branch for now.
from xsd2php.
It's not really the same thing, but it solves the same problem for me. I think this can be closed.
from xsd2php.
What about skipWhenEmpty
in https://github.com/schmittjoh/serializer/blob/master/src/JMS/Serializer/Annotation/XmlCollection.php#L41 ?
from xsd2php.
I guess that's an option, but this would mean I have to edit all of the generated metadata. And it would still never use the available ElementListAType
, even though that code was generated.
Do you know if it's possible to make not skipping empty lists the default in the serializer?
from xsd2php.
I guess that's an option, but this would mean I have to edit all of the generated metadata.
metadata are meant be be overwritten each time. are you editing them manually?
And it would still never use the available ElementListAType, even though that code was generated.
isn't the only the propose of this element to have tue list element present in the serialized XML? if you manage to do it via skipWhenEmpty = false
, everything should work fine, is it?
Do you know if it's possible to make not skipping empty lists the default in the serializer?
not possible for now
from xsd2php.
I'm not editing the metadata, that's actually exactly what I'm trying to avoid.
How can I apply skipWhenEmpty to the property without editing the metadata?
And yes, currently the only purpose of the element is to have it present in the serialized XML. That, and it feels like it makes "sense" in some cases to use the element instead of a plain array.
from xsd2php.
Actually, I realise that since the ElementList has a implicit minOccurs
of 1 it makes more sense to have the generator add the skip_when_empty: false
to any list that should occur at least once.
Maybe it's better to focus on that.
from xsd2php.
yes!
from xsd2php.
@jeroenvandergeer is this solved by #27 ?
from xsd2php.
Related Issues (20)
- types used in php classes are different than types used in the yaml configs HOT 3
- Namespace for array element - xml_list HOT 3
- Not working with Symfony HOT 1
- Deserializing boolean values HOT 6
- Handlers dosn't work. Class `GoetasWebservices\Xsd\XsdToPhp\XMLSchema\Date does not exist HOT 3
- xml attribute cause Uncaught ReflectionException: Class \ does not exist because it seaches empty class HOT 2
- Unable to generate PHP classes from XML file
- Validation metadata setting max count = 2 to elements with no maxOccurs.
- No namespace(s). What to do? HOT 1
- Problems with JMS-Metadata-Generator HOT 4
- Improper PHP code form choice element HOT 2
- Unable to generate PHP classes from XSD file HOT 3
- Declaration of Xsd2PhpExtension::getAlias() must be compatible with Symfony\Component\DependencyInjection\Extension\Extension::getAlias() HOT 4
- Better Handling of xsd:choice
- [Feature Request] Add option to add PHP type declarations
- Handling of xsd:squence with maxOccurs="unbounded"
- Composer requirements version HOT 3
- still uses psr/log:^1.0 - Please add support for psr/log:^3.0 and ^2.0 HOT 3
- CDATA sections not being disabled in XML despite setting xml_cdata to false in goetas-webservices/xsd2php HOT 2
- Can you help me create config.yml
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xsd2php.